Salome HOME
Boost has been removed from code
[modules/shaper.git] / src / ModelAPI / ModelAPI_ResultBody.h
1 // File:        ModelAPI_ResultBody.hxx
2 // Created:     07 Jul 2014
3 // Author:      Mikhail PONIKAROV
4
5 #ifndef ModelAPI_ResultBody_H_
6 #define ModelAPI_ResultBody_H_
7
8 #include "ModelAPI_Result.h"
9 #include <GeomAPI_Shape.h>
10 #include <GeomAlgoAPI_MakeShape.h>
11 #include <GeomAPI_DataMapOfShapeShape.h>
12 #include <memory>
13 #include <string>
14
15 /**\class ModelAPI_ResultBody
16 * \ingroup DataModel
17 * \brief The body (shape) result of a feature.
18 *
19 * Provides a shape that may be displayed in the viewer.
20 * May provide really huge results, so, working with this kind
21 * of result must be optimized.
22 */
23 class ModelAPI_ResultBody : public ModelAPI_Result
24 {
25 public:
26   /// Returns the group identifier of this result
27   virtual std::string groupName()
28   {
29     return group();
30   }
31
32   /// Returns the group identifier of this result
33   static std::string group()
34   {
35     static std::string MY_GROUP = "Bodies";
36     return MY_GROUP;
37   }
38
39   /// Stores the shape (called by the execution method).
40   virtual void store(const std::shared_ptr<GeomAPI_Shape>& theShape) = 0;
41
42   /// Stores the generated shape (called by the execution method).
43   virtual void storeGenerated(const std::shared_ptr<GeomAPI_Shape>& theFromShape,
44                                   const std::shared_ptr<GeomAPI_Shape>& theToShape) = 0;
45
46   /// Stores the modified shape (called by the execution method).
47   virtual void storeModified(const std::shared_ptr<GeomAPI_Shape>& theOldShape,
48                                   const std::shared_ptr<GeomAPI_Shape>& theNewShape) = 0;
49
50   /// Returns the shape-result produced by this feature
51   virtual std::shared_ptr<GeomAPI_Shape> shape() = 0;
52
53   /// Records the subshape newShape which was generated during a topological construction.
54   /// As an example, consider the case of a face generated in construction of a box.
55   virtual void generated(
56     const std::shared_ptr<GeomAPI_Shape>& theNewShape, const int theTag = 1) = 0;
57
58   /// Records the shape newShape which was generated from the shape oldShape during a topological 
59   /// construction. As an example, consider the case of a face generated from an edge in 
60   /// construction of a prism.
61   virtual void generated(const std::shared_ptr<GeomAPI_Shape>& theOldShape,
62     const std::shared_ptr<GeomAPI_Shape>& theNewShape, const int theTag = 1) = 0;
63
64   /// Records the shape newShape which is a modification of the shape oldShape.
65   /// As an example, consider the case of a face split or merged in a Boolean operation.
66   virtual void modified(const std::shared_ptr<GeomAPI_Shape>& theOldShape,
67     const std::shared_ptr<GeomAPI_Shape>& theNewShape, const int theTag = 1) = 0;
68
69   /// Records the shape oldShape which was deleted from the current label.
70   /// As an example, consider the case of a face removed by a Boolean operation.
71   virtual void deleted(
72     const std::shared_ptr<GeomAPI_Shape>& theOldShape, const int theTag = 1) = 0;
73   
74   /// load deleted shapes
75   virtual void loadDeletedShapes (GeomAlgoAPI_MakeShape* theMS,
76                                                std::shared_ptr<GeomAPI_Shape>  theShapeIn,
77                                                const int  theKindOfShape,
78                                                const int  theTag) = 0;
79   /// load and orient modified shapes
80   virtual void loadAndOrientModifiedShapes (
81                                                    GeomAlgoAPI_MakeShape* theMS,
82                                                std::shared_ptr<GeomAPI_Shape>  theShapeIn,
83                                                const int  theKindOfShape,
84                                                const int  theTag,
85                                                GeomAPI_DataMapOfShapeShape& theSubShapes) = 0;
86   /// load and orient generated shapes
87   virtual void loadAndOrientGeneratedShapes (
88                                                    GeomAlgoAPI_MakeShape* theMS,
89                                                std::shared_ptr<GeomAPI_Shape>  theShapeIn,
90                                                const int  theKindOfShape,
91                                                const int  theTag,
92                                                GeomAPI_DataMapOfShapeShape& theSubShapes) = 0;
93
94   /// load shapes of the first level (to be used during shape import)
95   virtual void loadFirstLevel(std::shared_ptr<GeomAPI_Shape> theShape, int&  theTag) = 0;
96   
97   /// load disconnected edges
98   virtual void loadDisconnectedEdges(std::shared_ptr<GeomAPI_Shape> theShape, int&  theTag) = 0;
99
100   /// load disconnected vetexes
101   virtual void loadDisconnectedVertexes(std::shared_ptr<GeomAPI_Shape> theShape, int&  theTag) = 0;
102
103 protected:
104 };
105
106 //! Pointer on feature object
107 typedef std::shared_ptr<ModelAPI_ResultBody> ResultBodyPtr;
108
109 #endif