]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
0021397: EDF SMESH: a quadrangle face mesh can't be projected to a cylinder
authoreap <eap@opencascade.com>
Fri, 28 Dec 2012 15:52:46 +0000 (15:52 +0000)
committereap <eap@opencascade.com>
Fri, 28 Dec 2012 15:52:46 +0000 (15:52 +0000)
   enable FindSubShapeAssociation() on faces with different nb of VERTEXes

src/StdMeshers/StdMeshers_ProjectionUtils.cxx

index 76785fad0e64139375d4bbb51da17ac0f2eeb8a4..13e2962da3a8c23b1c3489156f0cbf75cd1cd9df 100644 (file)
@@ -1118,7 +1118,11 @@ bool StdMeshers_ProjectionUtils::FindSubShapeAssociation(const TopoDS_Shape& the
   TopoDS_Vertex VV1[2], VV2[2];
 
   if ( vMap1.Extent() != vMap2.Extent() )
-    RETURN_BAD_RESULT("Different nb of vertices");
+  {
+    if ( HERE::Count( theShape1, TopAbs_EDGE, /*ignoreSame=*/false ) !=
+         HERE::Count( theShape2, TopAbs_EDGE, /*ignoreSame=*/false ))
+      RETURN_BAD_RESULT("Different nb of vertices");
+  }
 
   if ( vMap1.Extent() == 1 ) {
     InsertAssociation( vMap1(1), vMap2(1), theMap );
@@ -1158,10 +1162,10 @@ bool StdMeshers_ProjectionUtils::FindSubShapeAssociation(const TopoDS_Shape& the
   // Find transformation to make the shapes be of similar size at same location
 
   Bnd_Box box[2];
-  for ( int i = 1; i <= vMap1.Extent(); ++i ) {
+  for ( int i = 1; i <= vMap1.Extent(); ++i )
     box[ 0 ].Add( BRep_Tool::Pnt ( TopoDS::Vertex( vMap1( i ))));
+  for ( int i = 1; i <= vMap2.Extent(); ++i )
     box[ 1 ].Add( BRep_Tool::Pnt ( TopoDS::Vertex( vMap2( i ))));
-  }
 
   gp_Pnt gc[2]; // box center
   double x0,y0,z0, x1,y1,z1;
@@ -2223,7 +2227,7 @@ void StdMeshers_ProjectionUtils::SetEventListener(SMESH_subMesh* subMesh,
                                                   TopoDS_Shape   srcShape,
                                                   SMESH_Mesh*    srcMesh)
 {
-  // Set listener that resets an event listener on source submesh when
+  // Set the listener that resets an event listener on source submesh when
   // "ProjectionSource*D" hypothesis is modified since source shape can be changed
   subMesh->SetEventListener( GetHypModifWaiter(),0,subMesh);