Salome HOME
http://www.salome-platform.org/forum/forum_10/508123838#632325403 : Extrude3D doesn...
authoreap <eap@opencascade.com>
Mon, 9 Jul 2012 08:35:37 +0000 (08:35 +0000)
committereap <eap@opencascade.com>
Mon, 9 Jul 2012 08:35:37 +0000 (08:35 +0000)
  Restore error reporting in the case where existing 1D mesh
  mismatches the projected 2D mesh

src/StdMeshers/StdMeshers_Projection_2D.cxx

index 17bde5c85eed37d1f8bf7dcaf86882284d1b9b64..b4734fa0c6c531b40b0c82d3f3a94c75c1338cfd 100644 (file)
@@ -1007,24 +1007,18 @@ bool StdMeshers_Projection_2D::Compute(SMESH_Mesh& theMesh, const TopoDS_Shape&
         ( u2nodesMaps[ NEW_NODES ].size() == u2nodesOnSeam.size() );
 
       if ( !mergeNewToOld )
-      {
-        // if ( u2nodesMaps[ NEW_NODES ].size() == 0         &&
-        //      sm->GetSubShape().ShapeType() == TopAbs_EDGE &&
-        //      helper.IsDegenShape( sm->GetId() )             )
-        //   // NPAL15894 (tt88bis.py) - project mesh built by NETGEN_1d_2D that
-        //   // does not make segments/nodes on degenerated edges
-        //   continue;
-
-        // if ( u2nodesMaps[ OLD_NODES ].size() == 0           &&
-        //      sm->GetSubShape().ShapeType() == TopAbs_VERTEX )
-        //   // old nodes are optional on vertices in the case of 1D-2D projection
-        //   continue;
-
-        //RETURN_BAD_RESULT
-        MESSAGE("Different nb of old and new nodes on shape #"<< sm->GetId() <<" "<<
-                u2nodesMaps[ OLD_NODES ].size() << " != " <<
-                u2nodesMaps[ NEW_NODES ].size());
-      }
+        if ( u2nodesMaps[ NEW_NODES ].size() > 0 &&
+             u2nodesMaps[ OLD_NODES ].size() > 0 )
+        {
+          u_oldNode = u2nodesMaps[ OLD_NODES ].begin(); 
+          newEnd    = u2nodesMaps[ OLD_NODES ].end();
+          for ( ; u_oldNode != newEnd; ++u_oldNode )
+            _badInputElements.push_back( u_oldNode->second );
+          return error( COMPERR_BAD_INPUT_MESH,
+                        SMESH_Comment( "Existing mesh mismatches the projected 2D mesh on " )
+                        << ( sm->GetSubShape().ShapeType() == TopAbs_EDGE ? "edge" : "vertex" )
+                        << " #" << sm->GetId() );
+        }
       if ( isSeam && !mergeSeamToNew ) {
         //RETURN_BAD_RESULT
         MESSAGE("Different nb of old and seam nodes " <<