Salome HOME
Issue #1366: Remove Sub-Shapes feature added.
[modules/shaper.git] / src / GeomAlgoAPI / GeomAlgoAPI_ShapeTools.cpp
index 7f407d6778f19bb900b07e0cd1222a32484f48bf..69da4260882f0b8903c075284df8ba92ecd605f6 100644 (file)
@@ -22,6 +22,7 @@
 #include <BRepBuilderAPI_FindPlane.hxx>
 #include <BRepBuilderAPI_MakeEdge.hxx>
 #include <BRepBuilderAPI_MakeFace.hxx>
+#include <BRepCheck_Analyzer.hxx>
 #include <BRepExtrema_DistShapeShape.hxx>
 #include <BRepGProp.hxx>
 #include <BRepTopAdaptor_FClass2d.hxx>
@@ -599,3 +600,14 @@ bool GeomAlgoAPI_ShapeTools::isSubShapeInsideShape(const std::shared_ptr<GeomAPI
 
   return true;
 }
+
+//==================================================================================================
+bool GeomAlgoAPI_ShapeTools::isShapeValid(const std::shared_ptr<GeomAPI_Shape> theShape)
+{
+  if(!theShape.get()) {
+    return false;
+  }
+
+  BRepCheck_Analyzer aChecker(theShape->impl<TopoDS_Shape>());
+  return (aChecker.IsValid() == Standard_True);
+}
\ No newline at end of file