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< int > | GetMeshInfo () const |
Return info on sub-types of elements. More... | |
template<typename IDTYPE > | |
int | GetElementIds (IDTYPE *ids) const |
virtual int | Extent () const |
Returns nb of elements. More... | |
virtual bool | IsEmpty () |
Checks emptyness. More... | |
virtual bool | Contains (const int 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 int | GetID (const int theIndex) |
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 | |
const SMDS_MeshElement * | findInMesh (const int 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... | |
Private Attributes | |
SMESH_PredicatePtr | myPredicate |
std::vector< int > | myMeshInfo |
std::vector< const SMDS_MeshElement * > | myElements |
bool | myElementsOK |
size_t | myMeshModifTime |
int | myPredicateTic |
size_t | myNbElemToSkip |
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().
Checks if the element belongs to the group.
Reimplemented from SMESHDS_GroupBase.
References myPredicate.
|
virtual |
Checks if the element belongs to the group.
Reimplemented from SMESHDS_GroupBase.
References SMDS_MeshElement::GetID(), and 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_GroupOnGeom::Contains(), SMESHDS_Group::Contains(), and SMESHDS_Group::Remove().
|
inherited |
|
inherited |
References SMESHDS_GroupBase::GetColor().
Referenced by SMESH_GroupBase_i::GetColorNumber().
int 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(), me, myMeshInfo, setChanged(), setNbElemToSkip(), and SMDSEntity_Last.
|
virtual |
Return iterator on all elements.
Implements SMESHDS_GroupBase.
References SMDS_Mesh::elementsIterator(), Extent(), SMESHDS_GroupBase::GetMesh(), SMDS_Mesh::GetMeshInfo(), SMESHDS_GroupBase::GetType(), IsUpToDate(), me, myElements, myElementsOK, myNbElemToSkip, myPredicate, SMDS_MeshInfo::NbElements(), and updateParallel().
Referenced by getElementIds(), IsEmpty(), and update().
|
inherited |
|
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(), SMESHDS_GroupOnGeom::GetTic(), GetTic(), IsUpToDate(), setChanged(), SMESH::Controls::BelongToMeshGroup::SetMesh(), setNbElemToSkip(), SetPredicate(), and SMESHDS_GroupOnGeom::SetShape().
std::vector< int > SMESHDS_GroupOnFilter::GetMeshInfo | ( | ) | const |
Return info on sub-types of elements.
References myMeshInfo, and update().
SMESH_PredicatePtr SMESHDS_GroupOnFilter::GetPredicate | ( | ) | const |
|
inherited |
|
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(), SMESH_Mesh::ConvertToStandalone(), SMESH_Gen_i::CopyMesh(), SMESH_MeshEditor::CreateHoleSkin(), SMESHDS_GroupBase::findInMesh(), SMESH_MeshEditor::generateGroups(), SMESHDS_GroupOnGeom::GetElements(), GetElements(), SMESH_Mesh_i::GetElements(), DriverMED_R_SMESHDS_Mesh::GetGroup(), SMESH_GroupOnFilter_i::GetListOfID(), SMESH_GroupBase_i::GetType(), SMESH::Controls::BelongToMeshGroup::GetType(), StdMeshers_Import_1D::importMesh(), DriverMED_Family::Init(), DriverUNV_W_SMDS_Mesh::Perform(), DriverCGNS_Write::Perform(), 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().
|
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 |
|
virtualinherited |
Reimplemented in SMESHDS_Group.
References SMESHDS_GroupBase::myType.
Referenced by SMESHDS_Group::SetType().
|
private |
Updates myElements if necessary.
References GetElements(), SMDS_MeshElement::GetEntityType(), IsUpToDate(), me, myMeshInfo, setChanged(), setNbElemToSkip(), and updateParallel().
Referenced by Extent(), and GetMeshInfo().
|
private |
Updates myElements in parallel.
Referenced by GetElements(), and update().
|
private |
Referenced by GetElements(), and setChanged().
|
private |
Referenced by GetElements(), and setChanged().
|
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().