Salome HOME
92f1c04dfd7c2f0ef83e2bf3f2336a9a03b5d3aa
[modules/shaper.git] / src / GeomAlgoAPI / GeomAlgoAPI_MakeShapeList.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        GeomAlgoAPI_MakeShapeList.h
4 // Created:     27 May 2015
5 // Author:      Dmitry Bobylev
6 #ifndef GeomAlgoAPI_MakeShapeList_H_
7 #define GeomAlgoAPI_MakeShapeList_H_
8
9 #include <GeomAPI_Shape.h>
10 #include <GeomAlgoAPI.h>
11 #include <GeomAlgoAPI_MakeShape.h>
12
13 #include <memory>
14
15 /** \class GeomAlgoAPI_MakeShapeList
16  *  \ingroup DataAlgo
17  *  \brief Interface to the root class of all topological shapes constructions
18  */
19 class GeomAlgoAPI_MakeShapeList : public GeomAlgoAPI_MakeShape
20 {
21   enum OperationType {
22     Generated,
23     Modified
24   };
25
26 public:
27   /// Default constructor
28   GEOMALGOAPI_EXPORT GeomAlgoAPI_MakeShapeList();
29
30   /** \brief Constructor
31    *  \param[in] theMakeShapeList list of algorithms.
32    */
33   GEOMALGOAPI_EXPORT GeomAlgoAPI_MakeShapeList(const ListOfMakeShape& theMakeShapeList);
34
35   /** \brief Initializes a class with new list of algorithms.
36    *  \param[in] theMakeShapeList list of algorithms.
37    */
38   GEOMALGOAPI_EXPORT void init(const ListOfMakeShape& theMakeShapeList);
39
40   /** \brief Adds algo to the end of list.
41    *  \param[in] theMakeShape algo to be added.
42    */
43   GEOMALGOAPI_EXPORT void append(const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape);
44
45   /** \brief Adds another one list of algos to the end of list.
46    *  \param[in] theMakeShapeList algo list to be added.
47    */
48   GEOMALGOAPI_EXPORT void append(const GeomAlgoAPI_MakeShapeList& theMakeShapeList);
49
50   /// \return a shape built by the shape construction algorithms
51   GEOMALGOAPI_EXPORT const std::shared_ptr<GeomAPI_Shape> shape() const;
52
53   /// \return the list of shapes generated from the shape \a theShape
54   GEOMALGOAPI_EXPORT virtual void generated(const std::shared_ptr<GeomAPI_Shape> theShape,
55                                             ListOfShape& theHistory);
56
57   /// \return the list of shapes modified from the shape \a theShape
58   GEOMALGOAPI_EXPORT virtual void modified(const std::shared_ptr<GeomAPI_Shape> theShape,
59                                            ListOfShape& theHistory);
60
61   /// Returns whether the shape is deleted
62   GEOMALGOAPI_EXPORT virtual bool isDeleted(const std::shared_ptr<GeomAPI_Shape> theShape);
63
64 private:
65   void result(const std::shared_ptr<GeomAPI_Shape> theShape,
66               ListOfShape& theHistory,
67               OperationType theOperationType);
68
69
70 protected:
71   ListOfMakeShape myListOfMakeShape;
72 };
73
74 #endif