Salome HOME
0020943: EDF 1463 SMESH: additional fonctionnality to the feature 20749
authorvsr <vsr@opencascade.com>
Thu, 27 Jan 2011 10:14:07 +0000 (10:14 +0000)
committervsr <vsr@opencascade.com>
Thu, 27 Jan 2011 10:14:07 +0000 (10:14 +0000)
Fix "bare faces" control problem

src/Controls/SMESH_Controls.cxx

index 42b5b6a1a366b3fea541a7ad325aa64194d89e5a..b3f46743698edf60d803ae13a872e837b54fcc8f 100644 (file)
@@ -1956,11 +1956,13 @@ bool BareBorderVolume::IsSatisfy(long theElementId )
 
 bool BareBorderFace::IsSatisfy(long theElementId )
 {
 
 bool BareBorderFace::IsSatisfy(long theElementId )
 {
+  bool ok = false;
   if ( const SMDS_MeshElement* face = myMesh->FindElement(theElementId))
   if ( const SMDS_MeshElement* face = myMesh->FindElement(theElementId))
+  {
     if ( face->GetType() == SMDSAbs_Face )
     {
       int nbN = face->NbCornerNodes();
     if ( face->GetType() == SMDSAbs_Face )
     {
       int nbN = face->NbCornerNodes();
-      for ( int i = 0; i < nbN; ++i )
+      for ( int i = 0; i < nbN && !ok; ++i )
       {
         // check if a link is shared by another face
         const SMDS_MeshNode* n1 = face->GetNode( i );
       {
         // check if a link is shared by another face
         const SMDS_MeshNode* n1 = face->GetNode( i );
@@ -1979,11 +1981,12 @@ bool BareBorderFace::IsSatisfy(long theElementId )
           myLinkNodes[1] = n2;
           if ( face->IsQuadratic() )
             myLinkNodes[2] = face->GetNode( i+nbN );
           myLinkNodes[1] = n2;
           if ( face->IsQuadratic() )
             myLinkNodes[2] = face->GetNode( i+nbN );
-          return !myMesh->FindElement( myLinkNodes, SMDSAbs_Edge, /*noMedium=*/false);
+          ok = !myMesh->FindElement( myLinkNodes, SMDSAbs_Edge, /*noMedium=*/false);
         }
       }
     }
         }
       }
     }
-  return false;
+  }
+  return ok;
 }
 
 /*
 }
 
 /*