]> SALOME platform Git repositories - modules/shaper.git/blob - src/ModelAPI/ModelAPI_ResultBody.h
Salome HOME
Result CompSolid should inherits ResultBody. All model realization concerned Naming...
[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_BodyBuilder;
18
19 /**\class ModelAPI_ResultBody
20 * \ingroup DataModel
21 * \brief The body (shape) result of a feature.
22 *
23 * Provides a shape that may be displayed in the viewer.
24 * May provide really huge results, so, working with this kind
25 * of result must be optimized.
26 */
27 class ModelAPI_ResultBody : public ModelAPI_Result
28 {
29 public:
30   MODELAPI_EXPORT virtual ~ModelAPI_ResultBody();
31   /// Returns the group identifier of this result
32   MODELAPI_EXPORT virtual std::string groupName();
33
34   /// Returns the group identifier of this result
35   inline static std::string group()
36   {
37     static std::string MY_GROUP = "Bodies";
38     return MY_GROUP;
39   }
40
41   /// default color for a result body
42   inline static const std::string& DEFAULT_COLOR()
43   {
44     static const std::string RESULT_BODY_COLOR("150,150,180");
45     return RESULT_BODY_COLOR;
46   }
47
48   /// Returns the builder, which processes the shapes
49   ModelAPI_BodyBuilder* getBodyBuilder() { return myBuilder; }
50
51   /// Stores the shape (called by the execution method).
52   /*virtual void store(const std::shared_ptr<GeomAPI_Shape>& theShape) = 0;
53
54   /// Stores the generated shape (called by the execution method).
55   virtual void storeGenerated(const std::shared_ptr<GeomAPI_Shape>& theFromShape,
56                                   const std::shared_ptr<GeomAPI_Shape>& theToShape) = 0;
57
58   /// Stores the modified shape (called by the execution method).
59   virtual void storeModified(const std::shared_ptr<GeomAPI_Shape>& theOldShape,
60                                   const std::shared_ptr<GeomAPI_Shape>& theNewShape,
61                             const int theDecomposeSolidsTag = 0) = 0;
62
63   /// Records the subshape newShape which was generated during a topological construction.
64   /// As an example, consider the case of a face generated in construction of a box.
65   virtual void generated(
66     const std::shared_ptr<GeomAPI_Shape>& theNewShape, const std::string& theName, const int theTag = 1) = 0;
67
68   /// Records the shape newShape which was generated from the shape oldShape during a topological 
69   /// construction. As an example, consider the case of a face generated from an edge in 
70   /// construction of a prism.
71   virtual void generated(const std::shared_ptr<GeomAPI_Shape>& theOldShape,
72     const std::shared_ptr<GeomAPI_Shape>& theNewShape, const std::string& theName, const int theTag = 1) = 0;
73
74   /// Records the shape newShape which is a modification of the shape oldShape.
75   /// As an example, consider the case of a face split or merged in a Boolean operation.
76   virtual void modified(const std::shared_ptr<GeomAPI_Shape>& theOldShape,
77     const std::shared_ptr<GeomAPI_Shape>& theNewShape, const std::string& theName, const int theTag = 1) = 0;
78
79   /// Records the shape oldShape which was deleted from the current label.
80   /// As an example, consider the case of a face removed by a Boolean operation.
81   virtual void deleted(
82     const std::shared_ptr<GeomAPI_Shape>& theOldShape, const int theTag = 1) = 0;
83   
84   /// load deleted shapes
85   virtual void loadDeletedShapes (GeomAlgoAPI_MakeShape* theMS,
86                                                std::shared_ptr<GeomAPI_Shape>  theShapeIn,
87                                                const int  theKindOfShape,
88                                                const int  theTag) = 0;
89   /// load and orient modified shapes
90   virtual void loadAndOrientModifiedShapes (
91                                                    GeomAlgoAPI_MakeShape* theMS,
92                                                std::shared_ptr<GeomAPI_Shape>  theShapeIn,
93                                                const int  theKindOfShape,
94                                                const int  theTag,
95                                                                                            const std::string& theName,
96                                                GeomAPI_DataMapOfShapeShape& theSubShapes) = 0;
97   /// load and orient generated shapes
98   virtual void loadAndOrientGeneratedShapes (
99                                                    GeomAlgoAPI_MakeShape* theMS,
100                                                std::shared_ptr<GeomAPI_Shape>  theShapeIn,
101                                                const int  theKindOfShape,
102                                                const int  theTag,
103                                                                                            const std::string& theName,
104                                                GeomAPI_DataMapOfShapeShape& theSubShapes) = 0;
105
106   /// load shapes of the first level (to be used during shape import)
107   virtual void loadFirstLevel(std::shared_ptr<GeomAPI_Shape> theShape, const std::string& theName, int&  theTag) = 0;
108   
109   /// load disconnected edges
110   virtual void loadDisconnectedEdges(std::shared_ptr<GeomAPI_Shape> theShape, const std::string& theName, int&  theTag) = 0;
111
112   /// load disconnected vetexes
113   virtual void loadDisconnectedVertexes(std::shared_ptr<GeomAPI_Shape> theShape, const std::string& theName,int&  theTag) = 0;
114   */
115 protected:
116   MODELAPI_EXPORT ModelAPI_ResultBody();
117
118 protected:
119   ModelAPI_BodyBuilder* myBuilder; /// provide the body processing in naming shape
120 };
121
122 //! Pointer on feature object
123 typedef std::shared_ptr<ModelAPI_ResultBody> ResultBodyPtr;
124
125 #endif