Groups whose contents is dynamically updated using the filter. More...
#include <SMESHDS_GroupOnFilter.hxx>
Public Member Functions | |
SMESHDS_GroupOnFilter (const int theID, const SMESHDS_Mesh *theMesh, const SMDSAbs_ElementType theType, const SMESH_PredicatePtr &thePredicate) | |
Creates a group based on thePredicate. More... | |
void | SetPredicate (const SMESH_PredicatePtr &thePredicate) |
Sets a new predicate. More... | |
SMESH_PredicatePtr | GetPredicate () const |
std::vector< smIdType > | GetMeshInfo () const |
Return info on sub-types of elements. More... | |
template<typename IDTYPE > | |
smIdType | GetElementIds (IDTYPE *ids) const |
virtual smIdType | Extent () const |
Returns nb of elements. More... | |
virtual bool | IsEmpty () |
Checks emptyness. More... | |
virtual bool | Contains (const smIdType theID) |
Checks if the element belongs to the group. More... | |
virtual bool | Contains (const SMDS_MeshElement *elem) |
Checks if the element belongs to the group. More... | |
virtual SMDS_ElemIteratorPtr | GetElements () const |
Return iterator on all elements. More... | |
virtual int | GetTic () const |
Return a value allowing to find out if a group has changed or not. More... | |
bool | IsUpToDate () const |
Return false if update() is needed. More... | |
int | GetID () const |
virtual smIdType | GetID (const int theIndex) |
Don't use it! More... | |
const SMESHDS_Mesh * | GetMesh () const |
virtual void | SetType (SMDSAbs_ElementType theType) |
SMDSAbs_ElementType | GetType () const |
void | SetStoreName (const char *theName) |
const char * | GetStoreName () const |
void | SetColor (const Quantity_Color &theColor) |
Quantity_Color | GetColor () const |
void | SetColorGroup (int theColorGroup) |
int | GetColorGroup () const |
Static Public Member Functions | |
static void | SetDefaultColor (const Quantity_Color &theColor) |
Protected Member Functions | |
virtual SMDS_ElemIteratorPtr | getElements () |
Return elements before mesh compacting. More... | |
virtual void | tmpClear () |
clear myElements before re-filling after mesh compacting More... | |
virtual void | add (const SMDS_MeshElement *element) |
Re-fill myElements after mesh compacting. More... | |
virtual void | compact () |
allow the descendant treat its elements before mesh clearing More... | |
const SMDS_MeshElement * | findInMesh (const smIdType theID) const |
void | resetIterator () |
Internal method: resets cached iterator, should be called by ancestors when they are modified (ex: Add() or Remove() ) More... | |
Private Member Functions | |
void | update () const |
Updates myElements if necessary. More... | |
bool | updateParallel () const |
Updates myElements in parallel. More... | |
void | setChanged (bool changed=true) |
Sets myMeshModifTime and clear fields according to modification state. More... | |
const SMDS_MeshElement * | setNbElemToSkip (SMDS_ElemIteratorPtr &elIt) |
Sets myNbElemToSkip. More... | |
int | getElementIds (void *ids, size_t idSize) const |
Fill ids of elements. More... | |
virtual void | clear () |
void | beforeCompacting () |
store vtkIDs of elements More... | |
void | restoreElements (const std::vector< smIdType > &idNodessOldToNew, const std::vector< smIdType > &idCellsOldToNew) |
restore pointers to elements More... | |
Private Attributes | |
SMESH_PredicatePtr | myPredicate |
std::vector< smIdType > | myMeshInfo |
std::vector< const SMDS_MeshElement * > | myElements |
bool | myElementsOK |
size_t | myMeshModifTime |
int | myPredicateTic |
size_t | myNbElemToSkip |
int | myID |
const SMESHDS_Mesh * | myMesh |
SMDSAbs_ElementType | myType |
std::string | myStoreName |
Quantity_Color | myColor |
smIdType | myCurIndex |
smIdType | myCurID |
SMDS_ElemIteratorPtr | myIterator |
SMDS_Mesh * | myMesh |
std::vector< const SMDS_MeshElement * > | myExternalElems |
elements not contained in the mesh More... | |
std::vector< vtkIdType > | myVtkIDs |
vtk IDs of elements More... | |
std::vector< bool > | myIsNode |
std::set< SMDS_ElementHolder * >::iterator | myPtrInMesh |
Static Private Attributes | |
static Quantity_Color | myDefaultColor = Quantity_Color( 0.0, 0.0, 0.0, Quantity_TOC_RGB ) |
Groups whose contents is dynamically updated using the filter.
SMESHDS_GroupOnFilter::SMESHDS_GroupOnFilter | ( | const int | theID, |
const SMESHDS_Mesh * | theMesh, | ||
const SMDSAbs_ElementType | theType, | ||
const SMESH_PredicatePtr & | thePredicate | ||
) |
Creates a group based on thePredicate.
References SetPredicate().
|
protectedvirtual |
|
privateinherited |
store vtkIDs of elements
References SMDS_Mesh::Contains(), SMDS_ElementHolder::getElements(), SMDS_MeshElement::GetType(), SMDS_MeshElement::GetVtkID(), SMDS_MeshElement::IsNull(), SMDS_ElementHolder::myExternalElems, SMDS_ElementHolder::myIsNode, SMDS_ElementHolder::myMesh, SMDS_ElementHolder::myVtkIDs, and SMDSAbs_Node.
|
protectedvirtualinherited |
Reimplemented in SMESH_ProxyMesh::SubMesh.
Referenced by SMESH_MeshEditor::SplitBiQuadraticIntoLinear().
|
protectedvirtual |
allow the descendant treat its elements before mesh clearing
Implements SMDS_ElementHolder.
|
virtual |
Checks if the element belongs to the group.
Reimplemented from SMESHDS_GroupBase.
References SMDS_MeshElement::GetID(), and myPredicate.
|
virtual |
Checks if the element belongs to the group.
Reimplemented from SMESHDS_GroupBase.
References myPredicate.
|
virtual |
Returns nb of elements.
Reimplemented from SMESHDS_GroupBase.
References myMeshInfo, and update().
Referenced by GetElements(), and IsEmpty().
|
protectedinherited |
References SMDS_Mesh::FindElement(), SMDS_Mesh::FindNode(), SMESHDS_GroupBase::GetMesh(), SMESHDS_GroupBase::GetType(), SMDS_MeshElement::GetType(), SMDSAbs_All, and SMDSAbs_Node.
Referenced by SMESHDS_Group::Add(), SMESHDS_Group::Contains(), SMESHDS_GroupOnGeom::Contains(), and SMESHDS_Group::Remove().
|
inherited |
|
inherited |
References SMESHDS_GroupBase::GetColor().
Referenced by SMESH_GroupBase_i::GetColorNumber().
smIdType SMESHDS_GroupOnFilter::GetElementIds | ( | IDTYPE * | ids | ) | const |
|
private |
Fill ids of elements.
And return their number. ids must be pre-allocated using nb of elements of type == GetType()
References GetElements(), SMDS_MeshElement::GetEntityType(), SMDS_MeshElement::GetID(), IsUpToDate(), myMeshInfo, setChanged(), setNbElemToSkip(), and SMDSEntity_Last.
|
protectedvirtual |
|
virtual |
Return iterator on all elements.
Implements SMESHDS_GroupBase.
References SMDS_Mesh::elementsIterator(), Extent(), SMESHDS_GroupBase::GetMesh(), SMDS_Mesh::GetMeshInfo(), SMESHDS_GroupBase::GetType(), IsUpToDate(), myElements, myElementsOK, myNbElemToSkip, myPredicate, SMDS_MeshInfo::NbElements(), and updateParallel().
Referenced by getElementIds(), IsEmpty(), and update().
|
inherited |
Referenced by SMESH_Mesh::AddGroup(), SMESH_Mesh_i::CheckGeomGroupModif(), SMESH_Mesh_i::CheckGeomModif(), SMESH_MeshEditor::generateGroups(), SMESH_Group::GetID(), SMESH_GroupBase_i::GetID(), DriverUNV_W_SMDS_Mesh::Perform(), SMESH_Gen_i::Save(), SMESH::Controls::GroupColor::SetMesh(), and SMESH_Mesh::SynchronizeGroups().
|
virtualinherited |
Don't use it!
References SMESHDS_GroupBase::GetElements(), SMESHDS_GroupBase::myCurID, SMESHDS_GroupBase::myCurIndex, and SMESHDS_GroupBase::myIterator.
|
inherited |
Referenced by ChangeByPredicate(), StdMeshers_Import_1D::Compute(), StdMeshers_Import_1D2D::Compute(), SMESH_Mesh_i::CreateDimGroup(), SMESHDS_GroupBase::findInMesh(), GetElements(), SMESH_GroupOnFilter_i::GetListOfID(), StdMeshers_ImportSource1D::GetSourceMeshes(), StdMeshers_ImportSource1D::GetSourceSubMeshes(), GetTic(), SMESHDS_GroupOnGeom::GetTic(), IsUpToDate(), setChanged(), SMESH::Controls::BelongToMeshGroup::SetMesh(), setNbElemToSkip(), SetPredicate(), and SMESHDS_GroupOnGeom::SetShape().
std::vector< smIdType > SMESHDS_GroupOnFilter::GetMeshInfo | ( | ) | const |
Return info on sub-types of elements.
References myMeshInfo, and update().
SMESH_PredicatePtr SMESHDS_GroupOnFilter::GetPredicate | ( | ) | const |
|
inherited |
Referenced by SMESH_MeshEditor::generateGroups(), DriverMED_R_SMESHDS_Mesh::GetGroup(), DriverMED_Family::Init(), DriverCGNS_Write::Perform(), DriverGMF_Write::Perform(), DriverUNV_W_SMDS_Mesh::Perform(), StdMeshers_ImportSource1D::RestoreGroups(), SMESH_Gen_i::Save(), SMESH_PreMeshInfo::SaveToFile(), and SMESH_Group::SMESH_Group().
|
virtual |
Return a value allowing to find out if a group has changed or not.
Implements SMESHDS_GroupBase.
References SMESHDS_GroupBase::GetMesh(), SMDS_Mesh::GetMTime(), and myPredicateTic.
|
inherited |
Referenced by StdMeshers_QuadToTriaAdaptor::Compute(), SMESHDS_GroupOnGeom::Contains(), SMESH_Mesh::ConvertToStandalone(), SMESH_Gen_i::CopyMesh(), StdMeshers_ViscousLayers::CreateGroup(), SMESH_MeshEditor::CreateHoleSkin(), SMESH_Mesh::exportMEDCommmon(), SMESHDS_GroupBase::findInMesh(), SMESH_MeshEditor::generateGroups(), GetElements(), SMESHDS_GroupOnGeom::GetElements(), SMESH_Mesh_i::GetElements(), DriverMED_R_SMESHDS_Mesh::GetGroup(), SMESH_GroupOnFilter_i::GetListOfID(), SMESH_GroupBase_i::GetType(), SMESH::Controls::BelongToMeshGroup::GetType(), SMESH_Mesh::HasDuplicatedGroupNamesMED(), StdMeshers_Import_1D::importMesh(), DriverMED_Family::Init(), DriverCGNS_Write::Perform(), DriverUNV_W_SMDS_Mesh::Perform(), SMESHDS_Mesh::RemoveFreeNode(), SMESH::Controls::GroupColor::SetMesh(), setNbElemToSkip(), and SMESHDS_Group::SetType().
|
virtual |
Checks emptyness.
Reimplemented from SMESHDS_GroupBase.
References Extent(), GetElements(), IsUpToDate(), and setChanged().
bool SMESHDS_GroupOnFilter::IsUpToDate | ( | ) | const |
Return false if update() is needed.
References SMESHDS_GroupBase::GetMesh(), SMDS_Mesh::GetMTime(), and myMeshModifTime.
Referenced by getElementIds(), GetElements(), IsEmpty(), and update().
|
protectedinherited |
Internal method: resets cached iterator, should be called by ancestors when they are modified (ex: Add() or Remove() )
References SMESHDS_GroupBase::myCurID, and SMESHDS_GroupBase::myCurIndex.
Referenced by SMESHDS_Group::Add(), SMESHDS_Group::Clear(), and SMESHDS_Group::Remove().
|
privateinherited |
restore pointers to elements
References SMDS_ElementHolder::add(), SMDS_ElementHolder::compact(), SMDS_Mesh::FindElementVtk(), SMDS_Mesh::FindNodeVtk(), SMDS_ElementHolder::myExternalElems, SMDS_ElementHolder::myIsNode, SMDS_ElementHolder::myMesh, SMDS_ElementHolder::myVtkIDs, and SMDS_ElementHolder::tmpClear().
|
private |
Sets myMeshModifTime and clear fields according to modification state.
References SMESHDS_GroupBase::GetMesh(), SMDS_Mesh::GetMTime(), myElements, myElementsOK, myMeshInfo, myMeshModifTime, myNbElemToSkip, and SMDSEntity_Last.
Referenced by getElementIds(), IsEmpty(), SetPredicate(), and update().
|
inherited |
|
inherited |
References SMESHDS_GroupBase::SetColor().
Referenced by DriverMED_R_SMESHDS_Mesh::GetGroup(), and SMESH_GroupBase_i::SetColorNumber().
|
staticinherited |
Referenced by SMESH_Gen_i::SetOption().
|
private |
Sets myNbElemToSkip.
okElemIt | - iterator on OK elements |
const | SMDS_MeshElement* - the first OK element |
References SMDS_Mesh::elementsIterator(), SMESHDS_GroupBase::GetMesh(), SMESHDS_GroupBase::GetType(), and myNbElemToSkip.
Referenced by getElementIds(), and update().
void SMESHDS_GroupOnFilter::SetPredicate | ( | const SMESH_PredicatePtr & | thePredicate | ) |
Sets a new predicate.
References SMESHDS_GroupBase::GetMesh(), myPredicate, myPredicateTic, and setChanged().
Referenced by SMESHDS_GroupOnFilter().
|
inherited |
Referenced by SMESH_Mesh::ExportCGNS(), SMESH_Mesh::exportMEDCommmon(), SMESH_Mesh::ExportUNV(), SMESH_MeshEditor::generateGroups(), SMESH_Gen_i::Load(), SMESH_Mesh::MEDToMesh(), DriverCGNS_Read::Perform(), DriverGMF_Read::Perform(), SMESH_Gen_i::Save(), SMESH_Group::SetName(), SMESH_Group::SMESH_Group(), and SMESH_Mesh::UNVToMesh().
|
virtualinherited |
Reimplemented in SMESHDS_Group.
References SMESHDS_GroupBase::myType.
Referenced by SMESHDS_Group::SetType().
|
protectedvirtual |
clear myElements before re-filling after mesh compacting
Implements SMDS_ElementHolder.
References myElements.
|
private |
Updates myElements if necessary.
References GetElements(), SMDS_MeshElement::GetEntityType(), IsUpToDate(), myMeshInfo, setChanged(), setNbElemToSkip(), and updateParallel().
Referenced by Extent(), and GetMeshInfo().
|
private |
Updates myElements in parallel.
Referenced by GetElements(), and update().
|
privateinherited |
Referenced by SMESHDS_GroupBase::SMESHDS_GroupBase().
|
privateinherited |
Referenced by SMESHDS_GroupBase::GetID(), and SMESHDS_GroupBase::resetIterator().
|
privateinherited |
Referenced by SMESHDS_GroupBase::GetID(), and SMESHDS_GroupBase::resetIterator().
|
staticprivateinherited |
Referenced by SMESHDS_GroupBase::SMESHDS_GroupBase().
|
private |
Referenced by add(), getElements(), GetElements(), setChanged(), and tmpClear().
|
private |
Referenced by GetElements(), and setChanged().
|
privateinherited |
elements not contained in the mesh
Referenced by SMDS_ElementHolder::beforeCompacting(), and SMDS_ElementHolder::restoreElements().
|
privateinherited |
|
privateinherited |
Referenced by SMDS_ElementHolder::beforeCompacting(), and SMDS_ElementHolder::restoreElements().
|
privateinherited |
Referenced by SMESHDS_GroupBase::GetID().
|
protectedinherited |
|
privateinherited |
Referenced by SMESHDS_GroupBase::IsEmpty().
|
private |
Referenced by Extent(), getElementIds(), GetMeshInfo(), setChanged(), and update().
|
private |
Referenced by IsUpToDate(), and setChanged().
|
private |
Referenced by GetElements(), setChanged(), and setNbElemToSkip().
|
private |
Referenced by Contains(), GetElements(), and SetPredicate().
|
private |
Referenced by GetTic(), and SetPredicate().
|
privateinherited |
Referenced by SMDS_ElementHolder::SMDS_ElementHolder(), and SMDS_ElementHolder::~SMDS_ElementHolder().
|
privateinherited |
|
privateinherited |
Referenced by SMESHDS_GroupBase::IsEmpty(), and SMESHDS_GroupBase::SetType().
|
privateinherited |
vtk IDs of elements
Referenced by SMDS_ElementHolder::beforeCompacting(), and SMDS_ElementHolder::restoreElements().