- list< const SMDS_MeshElement* > faces;
- if ( nbElems > 0 ) {
- SMDS_ElemIteratorPtr fIt = fSubMesh->GetElements();
- while ( fIt->more() ) {
- const SMDS_MeshElement* f = fIt->next();
- if ( f && f->GetType() == SMDSAbs_Face )
- faces.push_back( f );
- }
- }
- else {
- SMDS_FaceIteratorPtr fIt = aMeshDS->facesIterator();
- while ( fIt->more() )
- faces.push_back( fIt->next() );
- }
+ SMDS_ElemIteratorPtr fIt;
+ if ( nbElems > 0 )
+ fIt = fSubMesh->GetElements();
+ else
+ fIt = aMeshDS->elementsIterator( SMDSAbs_Face );