Salome HOME
Fix for the bug "IPAL21999 Pattern Mapping - New - collapse of pattern mesh"
authorrnv <rnv@opencascade.com>
Thu, 21 Oct 2010 15:18:52 +0000 (15:18 +0000)
committerrnv <rnv@opencascade.com>
Thu, 21 Oct 2010 15:18:52 +0000 (15:18 +0000)
src/SMESH/SMESH_Pattern.cxx
src/SMESH/SMESH_Pattern.hxx

index 43ee8669da9ececd57a090d44061d2f76c73c105..0857f545d4ec09ebd2dd52337417f2620fe1c4f6 100644 (file)
@@ -766,7 +766,12 @@ bool SMESH_Pattern::Load (SMESH_Mesh*        theMesh,
             }
             paramNodeMap.insert( make_pair( u, node ));
           }
-        }
+
+          //rnv : To fix the bug IPAL21999 Pattern Mapping - New - collapse of pattern mesh
+          if ( paramNodeMap.size() != eSubMesh->NbNodes() )
+              return setErrorCode(ERR_UNEXPECTED);
+          }
+
         // put U in [0,1] so that the first key-point has U==0
         bool isSeam = helper.IsRealSeam( edge );
         double du = l - f;
index 4bac41585212723f49a7fe9bb477de4a9a4726cd..e809ca19595b4e6c6b1207f46690f0e31e662ed9 100644 (file)
@@ -191,7 +191,9 @@ class SMESH_EXPORT SMESH_Pattern {
     // Apply(mesh_face)
     ERR_APPLF_BAD_FACE_GEOM, // bad face geometry
     // MakeMesh
-    ERR_MAKEM_NOT_COMPUTED // mapping failed
+    ERR_MAKEM_NOT_COMPUTED, // mapping failed
+    //Unexpected error 
+    ERR_UNEXPECTED // Unexpected of the pattern mapping alorithm
   };
 
   ErrorCode GetErrorCode() const { return myErrorCode; }