X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESHDS%2FSMESHDS_GroupOnFilter.cxx;h=e5b2fb736bd3d75362f0f6aae9a85343fc3cf8bf;hp=7653e176ce6811b594cd62b99d60e335bf8d7079;hb=d8bc11015235c68631ac85d7e8cf278edc9809d1;hpb=911ca90c3d986ebefe41bf070c8f6506d0a69208 diff --git a/src/SMESHDS/SMESHDS_GroupOnFilter.cxx b/src/SMESHDS/SMESHDS_GroupOnFilter.cxx index 7653e176c..e5b2fb736 100644 --- a/src/SMESHDS/SMESHDS_GroupOnFilter.cxx +++ b/src/SMESHDS/SMESHDS_GroupOnFilter.cxx @@ -26,11 +26,14 @@ #include "SMESHDS_GroupOnFilter.hxx" #include "SMDS_SetIterator.hxx" +#include "ObjectPool.hxx" #include "SMESHDS_Mesh.hxx" #include #include +#include + using namespace std; //#undef WITH_TBB @@ -45,11 +48,12 @@ SMESHDS_GroupOnFilter::SMESHDS_GroupOnFilter (const int theID, const SMESHDS_Mesh* theMesh, const SMDSAbs_ElementType theType, const SMESH_PredicatePtr& thePredicate) - : SMESHDS_GroupBase(theID,theMesh,theType), + : SMESHDS_GroupBase( theID, theMesh, theType ), + SMDS_ElementHolder( theMesh ), myMeshInfo( SMDSEntity_Last, 0 ), - myMeshModifTime(0), - myPredicateTic(0), - myNbElemToSkip(0) + myMeshModifTime( 0 ), + myPredicateTic( 0 ), + myNbElemToSkip( 0 ) { SetPredicate( thePredicate ); } @@ -532,3 +536,38 @@ SMESHDS_GroupOnFilter::setNbElemToSkip( SMDS_ElemIteratorPtr& okElemIt ) } return firstOkElem; } + +//================================================================================ +/*! + * \brief Return elements before mesh compacting + */ +//================================================================================ + +SMDS_ElemIteratorPtr SMESHDS_GroupOnFilter::getElements() +{ + return boost::make_shared< SMDS_ElementVectorIterator >( myElements.begin(), myElements.end() ); +} + +//================================================================================ +/*! + * \brief clear myElements before re-filling after mesh compacting + */ +//================================================================================ + +void SMESHDS_GroupOnFilter::tmpClear() +{ + std::vector< const SMDS_MeshElement*> newElems( myElements.size() ); + myElements.swap( newElems ); + myElements.clear(); +} + +//================================================================================ +/*! + * \brief Re-fill myElements after mesh compacting + */ +//================================================================================ + +void SMESHDS_GroupOnFilter::add( const SMDS_MeshElement* element ) +{ + myElements.push_back( element ); +}