Salome HOME
Issue #1063: Problem of dynamic cast on Linux for Selection validators is solved
[modules/shaper.git] / src / GeomAlgoAPI / GeomAlgoAPI_MakeShape.h
index efafeceee7a73b9e43e4e0da183588b9f5588152..ea89fe89ede7807a76f8a2347c5cb96d53015ed8 100644 (file)
 class GeomAlgoAPI_MakeShape : public GeomAPI_Interface
 {
 public:
-  /// Constructor
-  GEOMALGOAPI_EXPORT GeomAlgoAPI_MakeShape();
-  /// Constructor by the already stored builder in the interface
-  GEOMALGOAPI_EXPORT GeomAlgoAPI_MakeShape(void* theBuilder);
+  /// Algo type enum
+  enum AlgoType {
+    MakeShape,
+    BOPAlgoBuilder
+  };
 
-  /// Constructor by the builder and wire. Used for pipe builder.
-  GEOMALGOAPI_EXPORT GeomAlgoAPI_MakeShape(void* theBuilder,
-                                           const std::shared_ptr<GeomAPI_Shape> theWire,
-                                           const std::shared_ptr<GeomAPI_Shape> theBaseShape);
+public:
+  /// Constructor by the already stored builder in the interface
+  GEOMALGOAPI_EXPORT GeomAlgoAPI_MakeShape(void* theBuilder, const AlgoType theAlgoType = MakeShape);
 
   /// Returns a shape built by the shape construction algorithm
-  GEOMALGOAPI_EXPORT const std::shared_ptr<GeomAPI_Shape>  shape() const;
+  GEOMALGOAPI_EXPORT virtual const std::shared_ptr<GeomAPI_Shape> shape() const;
 
   /// Returns the list of shapes generated from the shape \a theShape
   GEOMALGOAPI_EXPORT virtual void generated(
@@ -40,14 +40,17 @@ public:
   GEOMALGOAPI_EXPORT virtual void modified(
     const std::shared_ptr<GeomAPI_Shape> theShape, ListOfShape& theHistory);
 
-  /// Returns whether the shape is an edge
+  /// Returns whether the shape is deleted
   GEOMALGOAPI_EXPORT virtual bool isDeleted(const std::shared_ptr<GeomAPI_Shape> theShape);
 
-  protected:
-  /// The resulting shape
-  std::shared_ptr<GeomAPI_Shape> myShape;
-  std::shared_ptr<GeomAPI_Shape> myWire;
-  std::shared_ptr<GeomAPI_Shape> myBaseShape;
+protected:
+  GEOMALGOAPI_EXPORT GeomAlgoAPI_MakeShape(){};
+
+protected:
+  GeomAlgoAPI_MakeShape::AlgoType myAlgoType; ///< Type of make shape algo.
+  std::shared_ptr<GeomAPI_Shape> myShape; ///< Resulting shape.
+  std::shared_ptr<GeomAPI_Shape> myWire; ///< Wire for pipe algo.
+  std::shared_ptr<GeomAPI_Shape> myBaseShape; ///< Base shape of algo.
 };
 
 typedef std::list<std::shared_ptr<GeomAlgoAPI_MakeShape> > ListOfMakeShape;