Salome HOME
Filling operation: create a face from a set of edges/wires
[modules/shaper.git] / src / GeomAPI / GeomAPI_Shape.cpp
index c1df335558bd9f4f7680e158f68a43984bd27619..b634f3dcc28f17cef09b31e721bfc28ccece0b07 100644 (file)
@@ -103,6 +103,12 @@ bool GeomAPI_Shape::isEdge() const
   return !aShape.IsNull() && aShape.ShapeType() == TopAbs_EDGE;
 }
 
+bool GeomAPI_Shape::isWire() const
+{
+  const TopoDS_Shape& aShape = const_cast<GeomAPI_Shape*>(this)->impl<TopoDS_Shape>();
+  return !aShape.IsNull() && aShape.ShapeType() == TopAbs_WIRE;
+}
+
 bool GeomAPI_Shape::isFace() const
 {
   const TopoDS_Shape& aShape = const_cast<GeomAPI_Shape*>(this)->impl<TopoDS_Shape>();
@@ -408,7 +414,13 @@ void GeomAPI_Shape::setOrientation(const GeomAPI_Shape::Orientation theOrientati
   }
 }
 
-bool GeomAPI_Shape::isSubShape(const std::shared_ptr<GeomAPI_Shape> theShape) const
+void GeomAPI_Shape::reverse()
+{
+  MY_SHAPE->Reverse();
+}
+
+bool GeomAPI_Shape::isSubShape(const std::shared_ptr<GeomAPI_Shape> theShape,
+                               const bool theCheckOrientation) const
 {
   if(!theShape.get()) {
     return false;
@@ -420,7 +432,8 @@ bool GeomAPI_Shape::isSubShape(const std::shared_ptr<GeomAPI_Shape> theShape) co
   }
 
   for(TopExp_Explorer anExp(*MY_SHAPE, aShapeToSearch.ShapeType()); anExp.More(); anExp.Next()) {
-    if(aShapeToSearch.IsEqual(anExp.Current())) {
+    if(theCheckOrientation ?
+       aShapeToSearch.IsEqual(anExp.Current()) : aShapeToSearch.IsSame(anExp.Current())) {
       return true;
     }
   }