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