Salome HOME
Issue #761 - Check and error for unique parameter name
[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   MODELAPI_EXPORT virtual ~ModelAPI_ResultBody();
29   /// Returns the group identifier of this result
30   MODELAPI_EXPORT virtual std::string groupName();
31
32   /// Returns the group identifier of this result
33   inline static std::string group()
34   {
35     static std::string MY_GROUP = "Bodies";
36     return MY_GROUP;
37   }
38
39   /// default color for a result body
40   inline static const std::string& DEFAULT_COLOR()
41   {
42     static const std::string RESULT_BODY_COLOR("150,150,180");
43     return RESULT_BODY_COLOR;
44   }
45
46   /// Stores the shape (called by the execution method).
47   virtual void store(const std::shared_ptr<GeomAPI_Shape>& theShape) = 0;
48
49   /// Stores the generated shape (called by the execution method).
50   virtual void storeGenerated(const std::shared_ptr<GeomAPI_Shape>& theFromShape,
51                                   const std::shared_ptr<GeomAPI_Shape>& theToShape) = 0;
52
53   /// Stores the modified shape (called by the execution method).
54   virtual void storeModified(const std::shared_ptr<GeomAPI_Shape>& theOldShape,
55                                   const std::shared_ptr<GeomAPI_Shape>& theNewShape,
56                             const int theDecomposeSolidsTag = 0) = 0;
57
58   /// Records the subshape newShape which was generated during a topological construction.
59   /// As an example, consider the case of a face generated in construction of a box.
60   virtual void generated(
61     const std::shared_ptr<GeomAPI_Shape>& theNewShape, const std::string& theName, const int theTag = 1) = 0;
62
63   /// Records the shape newShape which was generated from the shape oldShape during a topological 
64   /// construction. As an example, consider the case of a face generated from an edge in 
65   /// construction of a prism.
66   virtual void generated(const std::shared_ptr<GeomAPI_Shape>& theOldShape,
67     const std::shared_ptr<GeomAPI_Shape>& theNewShape, const std::string& theName, const int theTag = 1) = 0;
68
69   /// Records the shape newShape which is a modification of the shape oldShape.
70   /// As an example, consider the case of a face split or merged in a Boolean operation.
71   virtual void modified(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 oldShape which was deleted from the current label.
75   /// As an example, consider the case of a face removed by a Boolean operation.
76   virtual void deleted(
77     const std::shared_ptr<GeomAPI_Shape>& theOldShape, const int theTag = 1) = 0;
78   
79   /// load deleted shapes
80   virtual void loadDeletedShapes (GeomAlgoAPI_MakeShape* theMS,
81                                                std::shared_ptr<GeomAPI_Shape>  theShapeIn,
82                                                const int  theKindOfShape,
83                                                const int  theTag) = 0;
84   /// load and orient modified shapes
85   virtual void loadAndOrientModifiedShapes (
86                                                    GeomAlgoAPI_MakeShape* theMS,
87                                                std::shared_ptr<GeomAPI_Shape>  theShapeIn,
88                                                const int  theKindOfShape,
89                                                const int  theTag,
90                                                                                            const std::string& theName,
91                                                GeomAPI_DataMapOfShapeShape& theSubShapes) = 0;
92   /// load and orient generated shapes
93   virtual void loadAndOrientGeneratedShapes (
94                                                    GeomAlgoAPI_MakeShape* theMS,
95                                                std::shared_ptr<GeomAPI_Shape>  theShapeIn,
96                                                const int  theKindOfShape,
97                                                const int  theTag,
98                                                                                            const std::string& theName,
99                                                GeomAPI_DataMapOfShapeShape& theSubShapes) = 0;
100
101   /// load shapes of the first level (to be used during shape import)
102   virtual void loadFirstLevel(std::shared_ptr<GeomAPI_Shape> theShape, const std::string& theName, int&  theTag) = 0;
103   
104   /// load disconnected edges
105   virtual void loadDisconnectedEdges(std::shared_ptr<GeomAPI_Shape> theShape, const std::string& theName, int&  theTag) = 0;
106
107   /// load disconnected vetexes
108   virtual void loadDisconnectedVertexes(std::shared_ptr<GeomAPI_Shape> theShape, const std::string& theName,int&  theTag) = 0;
109
110 protected:
111 };
112
113 //! Pointer on feature object
114 typedef std::shared_ptr<ModelAPI_ResultBody> ResultBodyPtr;
115
116 #endif