Salome HOME
Optimization of the widget code
[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 List of topological shapes constructions
18 class GeomAlgoAPI_MakeShapeList : public GeomAlgoAPI_MakeShape
19 {
20   enum OperationType {
21     Generated,
22     Modified
23   };
24
25 public:
26   /// Default constructor
27   GEOMALGOAPI_EXPORT GeomAlgoAPI_MakeShapeList();
28
29   /// \brief Constructor
30   /// \param[in] theMakeShapeList list of algorithms.
31   GEOMALGOAPI_EXPORT GeomAlgoAPI_MakeShapeList(const ListOfMakeShape& theMakeShapeList);
32
33   /// \brief Initializes a class with new list of algorithms.
34   /// \param[in] theMakeShapeList list of algorithms.
35   GEOMALGOAPI_EXPORT void init(const ListOfMakeShape& theMakeShapeList);
36
37   /// \brief Adds algo to the end of list.
38   /// \param[in] theMakeShape algo to be added.
39   GEOMALGOAPI_EXPORT void appendAlgo(const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape);
40
41   /// \return a shape built by the shape construction algorithms
42   GEOMALGOAPI_EXPORT virtual const std::shared_ptr<GeomAPI_Shape> shape() const;
43
44   /// \return the list of shapes generated from the shape \a theShape
45   GEOMALGOAPI_EXPORT virtual void generated(const std::shared_ptr<GeomAPI_Shape> theShape,
46                                             ListOfShape& theHistory);
47
48   /// \return the list of shapes modified from the shape \a theShape
49   GEOMALGOAPI_EXPORT virtual void modified(const std::shared_ptr<GeomAPI_Shape> theShape,
50                                            ListOfShape& theHistory);
51
52   /// \return whether the shape is deleted
53   GEOMALGOAPI_EXPORT virtual bool isDeleted(const std::shared_ptr<GeomAPI_Shape> theShape);
54
55 private:
56   void result(const std::shared_ptr<GeomAPI_Shape> theShape,
57               OperationType theOperationType,
58               ListOfShape& theHistory);
59
60 protected:
61   ListOfMakeShape myListOfMakeShape; ///< List of make shape algos.
62 };
63
64 #endif