ElementsOnSurface::ElementsOnSurface()
{
- myMesh = 0;
myIds.Clear();
myType = SMDSAbs_All;
mySurf.Nullify();
ElementsOnSurface::~ElementsOnSurface()
{
- myMesh = 0;
}
void ElementsOnSurface::SetMesh( const SMDS_Mesh* theMesh )
{
- if ( myMesh == theMesh )
- return;
- myMesh = theMesh;
- process();
+ myMeshModifTracer.SetMesh( theMesh );
+ if ( myMeshModifTracer.IsMeshModified())
+ process();
}
bool ElementsOnSurface::IsSatisfy( long theElementId )
if ( mySurf.IsNull() )
return;
- if ( myMesh == 0 )
+ if ( !myMeshModifTracer.GetMesh() )
return;
- if ( myType == SMDSAbs_Face || myType == SMDSAbs_All )
- {
- myIds.ReSize( myMesh->NbFaces() );
- SMDS_FaceIteratorPtr anIter = myMesh->facesIterator();
- for(; anIter->more(); )
- process( anIter->next() );
- }
-
- if ( myType == SMDSAbs_Edge || myType == SMDSAbs_All )
- {
- myIds.ReSize( myIds.Extent() + myMesh->NbEdges() );
- SMDS_EdgeIteratorPtr anIter = myMesh->edgesIterator();
- for(; anIter->more(); )
- process( anIter->next() );
- }
+ myIds.ReSize( myMeshModifTracer.GetMesh()->GetMeshInfo().NbElements( myType ));
- if ( myType == SMDSAbs_Node )
- {
- myIds.ReSize( myMesh->NbNodes() );
- SMDS_NodeIteratorPtr anIter = myMesh->nodesIterator();
- for(; anIter->more(); )
- process( anIter->next() );
- }
+ SMDS_ElemIteratorPtr anIter = myMeshModifTracer.GetMesh()->elementsIterator( myType );
+ for(; anIter->more(); )
+ process( anIter->next() );
}
void ElementsOnSurface::process( const SMDS_MeshElement* theElemPtr )
bool isOnSurface( const SMDS_MeshNode* theNode );
private:
- const SMDS_Mesh* myMesh;
+ TMeshModifTracer myMeshModifTracer;
TColStd_MapOfInteger myIds;
SMDSAbs_ElementType myType;
//Handle(Geom_Surface) mySurf;