]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
a little optimize FindFace (std::vector<const SMDS_MeshNode *> nodes)
authoreap <eap@opencascade.com>
Tue, 9 Mar 2010 08:17:43 +0000 (08:17 +0000)
committereap <eap@opencascade.com>
Tue, 9 Mar 2010 08:17:43 +0000 (08:17 +0000)
src/SMDS/SMDS_Mesh.cxx

index fb7bd9a94d14c571d92f4cbc59d682790a14f9e6..0f3ea745b8286ac264cdb9e5c76b3ce22f6b34a9 100644 (file)
@@ -1782,15 +1782,10 @@ const SMDS_MeshFace* SMDS_Mesh::FindFace (std::vector<const SMDS_MeshNode *> nod
     while (itF->more()) {
       const SMDS_MeshElement* f = itF->next();
       if ( f->NbNodes() == nodes.size() ) {
-        SMDS_ElemIteratorPtr it2 = f->nodesIterator();
-        while(it2->more()) {
-          if ( find( nodes.begin(), nodes.end(), it2->next() ) == nodes.end() ) {
-            f = 0;
-            break;
-          }
-        }
-        if ( f )
-          return static_cast<const SMDS_MeshFace *> (f);
+        for ( int i = 1; i < nodes.size(); ++ i )
+          if ( f->GetNodeIndex( nodes[ i ]) < 0 )
+            return NULL;
+        return static_cast<const SMDS_MeshFace *> (f);
       }
     }
   }