X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FSMESH%2FSMESH_Pattern.cxx;h=eae5aee77376184e0c0b280ba077ec7d2b506e7a;hb=refs%2Ftags%2FV7_7_0b1;hp=f92b56bf9a1383f909208e0de99036a4e5b6aa2f;hpb=8972ce9d8445b6f859176d894c22b62499bf5616;p=modules%2Fsmesh.git diff --git a/src/SMESH/SMESH_Pattern.cxx b/src/SMESH/SMESH_Pattern.cxx index f92b56bf9..eae5aee77 100644 --- a/src/SMESH/SMESH_Pattern.cxx +++ b/src/SMESH/SMESH_Pattern.cxx @@ -620,39 +620,26 @@ bool SMESH_Pattern::Load (SMESH_Mesh* theMesh, // --------------------------------------------------------------- // get all faces - 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 ); // put nodes of all faces into the nodePointIDMap and fill myElemPointIDs - list< const SMDS_MeshElement* >::iterator fIt = faces.begin(); - for ( ; fIt != faces.end(); ++fIt ) + while ( fIt->more() ) { + const SMDS_MeshElement* face = fIt->next(); myElemPointIDs.push_back( TElemDef() ); TElemDef& elemPoints = myElemPointIDs.back(); - int nbNodes = (*fIt)->NbCornerNodes(); + int nbNodes = face->NbCornerNodes(); for ( int i = 0;i < nbNodes; ++i ) { - const SMDS_MeshElement* node = (*fIt)->GetNode( i ); + const SMDS_MeshElement* node = face->GetNode( i ); TNodePointIDMap::iterator nIdIt = nodePointIDMap.insert( make_pair( node, -1 )).first; if ( nIdIt->second == -1 ) - { - elemPoints.push_back( iPoint ); nIdIt->second = iPoint++; - } - else - elemPoints.push_back( (*nIdIt).second ); + elemPoints.push_back( (*nIdIt).second ); } } myPoints.resize( iPoint );