OCC22139 Statuses of BRepMesh
authorOAN <>
Thu, 28 Apr 2011 15:14:45 +0000 (15:14 +0000)
committerbugmaster <bugmaster@opencascade.com>
Mon, 5 Mar 2012 15:27:54 +0000 (19:27 +0400)
src/BRepMesh/BRepMesh_IncrementalMesh.cdl
src/BRepMesh/BRepMesh_IncrementalMesh.cxx

index e9a60e5..cf4c5e1 100755 (executable)
@@ -21,7 +21,8 @@ uses
     MapOfShape  from TopTools,
     IndexedDataMapOfShapeListOfShape from TopTools,
     DataMapOfShapeReal from TopTools,
     MapOfShape  from TopTools,
     IndexedDataMapOfShapeListOfShape from TopTools,
     DataMapOfShapeReal from TopTools,
-    FastDiscret from BRepMesh      
+    FastDiscret from BRepMesh,
+    Status      from BRepMesh
 
 is      
     Create
 
 is      
     Create
@@ -72,6 +73,9 @@ is
             --          correctly, the triangulation  of this face  is
             --          built.
        is static private;
             --          correctly, the triangulation  of this face  is
             --          built.
        is static private;
+      
+    EchoStatus(me)
+      is static;
        
       
 fields
        
       
 fields
index dd3763e..ba8c665 100755 (executable)
@@ -140,26 +140,53 @@ void BRepMesh_IncrementalMesh::Perform()
   Init(); 
   //
   BRepBndLib::Add(myShape, aBox);
   Init(); 
   //
   BRepBndLib::Add(myShape, aBox);
-  if (aBox.IsVoid() == Standard_False)
-  {
-    myBox = aBox;
+  myBox = aBox;
   //
   //
-    if (!myMesh.IsNull()) {
-      myMesh.Nullify();
-    }
+  if (!myMesh.IsNull()) {
+    myMesh.Nullify();
+  }
   //
   //
-    myMesh = new BRepMesh_FastDiscret(myDeflection,
-                                      myAngle,
-                                      aBox,
-                                      Standard_True,
-                                      Standard_True,
-                                      myRelative,
-                                      Standard_True);
+  myMesh = new BRepMesh_FastDiscret(myDeflection,
+                                   myAngle,
+                                   aBox,
+                                   Standard_True,
+                                   Standard_True,
+                                   myRelative,
+                                   Standard_True);
   //
   //
-    Update(myShape);
-  }
+  Update(myShape);
+#ifdef DEB
+  EchoStatus();
+#endif
 }
 
 }
 
+//=======================================================================
+//function : EchoStatus
+//purpose  : 
+//=======================================================================
+void BRepMesh_IncrementalMesh::EchoStatus() const
+{
+  cout << "BRepMesh_FastDiscret::Meshing status: ";
+  switch(myMesh->CurrentFaceStatus())
+  {
+    case BRepMesh_NoError:
+      cout << "NoError" << endl;
+      break;
+    case BRepMesh_OpenWire:
+      cout << "OpenWire" << endl;
+      break;
+    case BRepMesh_SelfIntersectingWire:
+      cout << "SelfIntersectingWire" << endl;
+      break;
+    case BRepMesh_Failure:
+      cout << "Failure" << endl;
+      break;
+    case BRepMesh_ReMesh:
+      cout << "ReMesh" << endl;
+      break;
+    default: cout << "UnsupportedStatus" << endl;
+  }
+}
 
 //=======================================================================
 //function : Update(shape)
 
 //=======================================================================
 //function : Update(shape)