Salome HOME
Fix for the issue #1100
[modules/shaper.git] / src / GeomAlgoAPI / GeomAlgoAPI_MakeShape.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        GeomAlgoAPI_MakeShape.h
4 // Created:     17 Oct 2014
5 // Author:      Sergey ZARITCHNY
6 #ifndef GeomAlgoAPI_MakeShape_H_
7 #define GeomAlgoAPI_MakeShape_H_
8
9 #include <GeomAPI_Shape.h>
10 #include <GeomAlgoAPI.h>
11
12 #include <list>
13 #include <memory>
14
15 /**\class GeomAlgoAPI_MakeShape
16  * \ingroup DataAlgo
17  * \brief Interface to the root class of all topological shapes constructions
18  */
19 class GeomAlgoAPI_MakeShape : public GeomAPI_Interface
20 {
21 public:
22   /// Algo type enum
23   enum AlgoType {
24     MakeShape,
25     BOPAlgoBuilder
26   };
27
28 public:
29   /// Constructor by the already stored builder in the interface
30   GEOMALGOAPI_EXPORT GeomAlgoAPI_MakeShape(void* theBuilder, const AlgoType theAlgoType = MakeShape);
31
32   /// Returns a shape built by the shape construction algorithm
33   GEOMALGOAPI_EXPORT virtual const std::shared_ptr<GeomAPI_Shape> shape() const;
34
35   /// Returns the list of shapes generated from the shape \a theShape
36   GEOMALGOAPI_EXPORT virtual void generated(
37     const std::shared_ptr<GeomAPI_Shape> theShape, ListOfShape& theHistory);
38
39   /// Returns the  list of shapes modified from the shape \a theShape
40   GEOMALGOAPI_EXPORT virtual void modified(
41     const std::shared_ptr<GeomAPI_Shape> theShape, ListOfShape& theHistory);
42
43   /// Returns whether the shape is deleted
44   GEOMALGOAPI_EXPORT virtual bool isDeleted(const std::shared_ptr<GeomAPI_Shape> theShape);
45
46 protected:
47   GEOMALGOAPI_EXPORT GeomAlgoAPI_MakeShape(){};
48
49 protected:
50   GeomAlgoAPI_MakeShape::AlgoType myAlgoType; ///< Type of make shape algo.
51   std::shared_ptr<GeomAPI_Shape> myShape; ///< Resulting shape.
52   std::shared_ptr<GeomAPI_Shape> myWire; ///< Wire for pipe algo.
53   std::shared_ptr<GeomAPI_Shape> myBaseShape; ///< Base shape of algo.
54 };
55
56 typedef std::list<std::shared_ptr<GeomAlgoAPI_MakeShape> > ListOfMakeShape;
57
58 #endif