0021339: EDF 1928 SMESH: Create group of 0D elements

Use TMeshModifTracer in ElementsOnSurface
This commit is contained in:
eap 2012-10-25 10:37:56 +00:00
parent 6d1ea10cad
commit c128018070
2 changed files with 9 additions and 30 deletions

View File

@ -3529,7 +3529,6 @@ void ManifoldPart::getFacesByLink( const ManifoldPart::Link& theLink,
ElementsOnSurface::ElementsOnSurface() ElementsOnSurface::ElementsOnSurface()
{ {
myMesh = 0;
myIds.Clear(); myIds.Clear();
myType = SMDSAbs_All; myType = SMDSAbs_All;
mySurf.Nullify(); mySurf.Nullify();
@ -3539,14 +3538,12 @@ ElementsOnSurface::ElementsOnSurface()
ElementsOnSurface::~ElementsOnSurface() ElementsOnSurface::~ElementsOnSurface()
{ {
myMesh = 0;
} }
void ElementsOnSurface::SetMesh( const SMDS_Mesh* theMesh ) void ElementsOnSurface::SetMesh( const SMDS_Mesh* theMesh )
{ {
if ( myMesh == theMesh ) myMeshModifTracer.SetMesh( theMesh );
return; if ( myMeshModifTracer.IsMeshModified())
myMesh = theMesh;
process(); process();
} }
@ -3602,34 +3599,16 @@ void ElementsOnSurface::process()
if ( mySurf.IsNull() ) if ( mySurf.IsNull() )
return; return;
if ( myMesh == 0 ) if ( !myMeshModifTracer.GetMesh() )
return; return;
if ( myType == SMDSAbs_Face || myType == SMDSAbs_All ) myIds.ReSize( myMeshModifTracer.GetMesh()->GetMeshInfo().NbElements( myType ));
{
myIds.ReSize( myMesh->NbFaces() );
SMDS_FaceIteratorPtr anIter = myMesh->facesIterator();
for(; anIter->more(); )
process( anIter->next() );
}
if ( myType == SMDSAbs_Edge || myType == SMDSAbs_All ) SMDS_ElemIteratorPtr anIter = myMeshModifTracer.GetMesh()->elementsIterator( myType );
{
myIds.ReSize( myIds.Extent() + myMesh->NbEdges() );
SMDS_EdgeIteratorPtr anIter = myMesh->edgesIterator();
for(; anIter->more(); ) for(; anIter->more(); )
process( anIter->next() ); process( anIter->next() );
} }
if ( myType == SMDSAbs_Node )
{
myIds.ReSize( myMesh->NbNodes() );
SMDS_NodeIteratorPtr anIter = myMesh->nodesIterator();
for(; anIter->more(); )
process( anIter->next() );
}
}
void ElementsOnSurface::process( const SMDS_MeshElement* theElemPtr ) void ElementsOnSurface::process( const SMDS_MeshElement* theElemPtr )
{ {
SMDS_ElemIteratorPtr aNodeItr = theElemPtr->nodesIterator(); SMDS_ElemIteratorPtr aNodeItr = theElemPtr->nodesIterator();

View File

@ -783,7 +783,7 @@ namespace SMESH{
bool isOnSurface( const SMDS_MeshNode* theNode ); bool isOnSurface( const SMDS_MeshNode* theNode );
private: private:
const SMDS_Mesh* myMesh; TMeshModifTracer myMeshModifTracer;
TColStd_MapOfInteger myIds; TColStd_MapOfInteger myIds;
SMDSAbs_ElementType myType; SMDSAbs_ElementType myType;
//Handle(Geom_Surface) mySurf; //Handle(Geom_Surface) mySurf;