0026118: Implement FastSewing algorithm
[occt.git] / src / MeshTest / MeshTest.cxx
index cb030eb..103ffc6 100644 (file)
@@ -81,6 +81,7 @@
 #include <BRepAdaptor_Surface.hxx>
 #include <Bnd_Box.hxx>
 #include <BRepBndLib.hxx>
+#include <BRepLib.hxx>
 
 
 //epa Memory leaks test
@@ -1589,6 +1590,31 @@ Standard_Integer triedgepoints(Draw_Interpretor& di, Standard_Integer nbarg, con
   return 0;
 }
 
+//=======================================================================
+//function : correctnormals
+//purpose  : Corrects normals in shape triangulation nodes (...)
+//=======================================================================
+Standard_Integer correctnormals (Draw_Interpretor& theDI, 
+                            Standard_Integer /*theNArg*/, 
+                            const char** theArgVal)
+{
+  TopoDS_Shape S = DBRep::Get(theArgVal[1]);
+
+  //Use "correctnormals shape"
+
+  
+  if(!BRepLib::EnsureNormalConsistency(S))
+  {
+    theDI << "Normals have not been changed!\n";
+  }
+  else
+  {
+    theDI << "Some corrections in source shape have been made!\n";
+  }
+
+  return 0;
+}
+
 //=======================================================================
 void  MeshTest::Commands(Draw_Interpretor& theCommands)
 //=======================================================================
@@ -1623,6 +1649,8 @@ void  MeshTest::Commands(Draw_Interpretor& theCommands)
   theCommands.Add("onetriangulation","onetriangulation name",__FILE__, onetriangulation, g);
   theCommands.Add("triepoints", "triepoints shape1 [shape2 ...]",__FILE__, triedgepoints, g);
 
+  theCommands.Add("correctnormals", "correctnormals shape",__FILE__, correctnormals, g);
+
 #if 0
   theCommands.Add("extrema","extrema ",__FILE__, extrema, g);
   theCommands.Add("vb","vb ",__FILE__, vb, g);