]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
precise error messages
authoreap <eap@opencascade.com>
Thu, 22 Mar 2012 12:42:58 +0000 (12:42 +0000)
committereap <eap@opencascade.com>
Thu, 22 Mar 2012 12:42:58 +0000 (12:42 +0000)
src/StdMeshers/StdMeshers_Import_1D2D.cxx

index 326aeaa1186e3d0ccd5d83d30b78a919a6fa2172..cd8f4acfdb7c6983164df6fc9daf016fdcfe55db 100644 (file)
@@ -420,10 +420,14 @@ bool StdMeshers_Import_1D2D::Compute(SMESH_Mesh & theMesh, const TopoDS_Shape &
           }
         }
         if ( !nodesOnBoundary )
-          break; // error: free internal link
+        {
+          error("free internal link"); // just for an easier debug
+          break;
+        }
         if ( bndShapes.front().ShapeType() == TopAbs_EDGE &&
              bndShapes.front() != bndShapes.back() )
-          break; // error: link nodes on different geom edges
+          // link nodes on different geom edges
+          return error(COMPERR_BAD_INPUT_MESH, "Source nodes mismatch target vertices");
 
         // find geom edge the link is on
         if ( bndShapes.back().ShapeType() != TopAbs_EDGE )
@@ -433,7 +437,10 @@ bool StdMeshers_Import_1D2D::Compute(SMESH_Mesh & theMesh, const TopoDS_Shape &
                                                             bndShapes.front(),
                                                             theMesh, TopAbs_EDGE );
           if ( geomEdge.IsNull() )
-            break; // vertices belong to different edges -> error: free internal link
+          {
+            error("free internal link");
+            break; // vertices belong to different edges
+          }
           bndShapes.push_back( geomEdge );
         }
 
@@ -465,7 +472,7 @@ bool StdMeshers_Import_1D2D::Compute(SMESH_Mesh & theMesh, const TopoDS_Shape &
       }
       else if ( nbFaces > 2 )
       {
-        return error( "Non-manifold source mesh");
+        return error( COMPERR_BAD_INPUT_MESH, "Non-manifold source mesh");
       }
     }
     isFaceMeshed = ( link2Nb == linkCount.end() && !linkCount.empty());
@@ -491,12 +498,13 @@ bool StdMeshers_Import_1D2D::Compute(SMESH_Mesh & theMesh, const TopoDS_Shape &
         if ( nbEdges < 2 )
           return false; // weird
         if ( nbEdges > 2 )
-          return error( "Source elements overlap one another");
+          return error( COMPERR_BAD_INPUT_MESH, "Source elements overlap one another");
       }
     }
   }
   if ( !isFaceMeshed )
-    return error( "Source elements don't cover totally the geometrical face" );
+    return error( COMPERR_BAD_INPUT_MESH,
+                  "Source elements don't cover totally the geometrical face" );
 
   if ( helper.HasSeam() )
   {