Salome HOME
Fix for the issue #686: now compounds produced by the Boolean operations can be corre...
[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   /// 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,
49                             const int theDecomposeSolidsTag = 0) = 0;
50
51   /// Records the subshape newShape which was generated during a topological construction.
52   /// As an example, consider the case of a face generated in construction of a box.
53   virtual void generated(
54     const std::shared_ptr<GeomAPI_Shape>& theNewShape, const std::string& theName, const int theTag = 1) = 0;
55
56   /// Records the shape newShape which was generated from the shape oldShape during a topological 
57   /// construction. As an example, consider the case of a face generated from an edge in 
58   /// construction of a prism.
59   virtual void generated(const std::shared_ptr<GeomAPI_Shape>& theOldShape,
60     const std::shared_ptr<GeomAPI_Shape>& theNewShape, const std::string& theName, const int theTag = 1) = 0;
61
62   /// Records the shape newShape which is a modification of the shape oldShape.
63   /// As an example, consider the case of a face split or merged in a Boolean operation.
64   virtual void modified(const std::shared_ptr<GeomAPI_Shape>& theOldShape,
65     const std::shared_ptr<GeomAPI_Shape>& theNewShape, const std::string& theName, const int theTag = 1) = 0;
66
67   /// Records the shape oldShape which was deleted from the current label.
68   /// As an example, consider the case of a face removed by a Boolean operation.
69   virtual void deleted(
70     const std::shared_ptr<GeomAPI_Shape>& theOldShape, const int theTag = 1) = 0;
71   
72   /// load deleted shapes
73   virtual void loadDeletedShapes (GeomAlgoAPI_MakeShape* theMS,
74                                                std::shared_ptr<GeomAPI_Shape>  theShapeIn,
75                                                const int  theKindOfShape,
76                                                const int  theTag) = 0;
77   /// load and orient modified shapes
78   virtual void loadAndOrientModifiedShapes (
79                                                    GeomAlgoAPI_MakeShape* theMS,
80                                                std::shared_ptr<GeomAPI_Shape>  theShapeIn,
81                                                const int  theKindOfShape,
82                                                const int  theTag,
83                                                                                            const std::string& theName,
84                                                GeomAPI_DataMapOfShapeShape& theSubShapes) = 0;
85   /// load and orient generated shapes
86   virtual void loadAndOrientGeneratedShapes (
87                                                    GeomAlgoAPI_MakeShape* theMS,
88                                                std::shared_ptr<GeomAPI_Shape>  theShapeIn,
89                                                const int  theKindOfShape,
90                                                const int  theTag,
91                                                                                            const std::string& theName,
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, const std::string& theName, int&  theTag) = 0;
96   
97   /// load disconnected edges
98   virtual void loadDisconnectedEdges(std::shared_ptr<GeomAPI_Shape> theShape, const std::string& theName, int&  theTag) = 0;
99
100   /// load disconnected vetexes
101   virtual void loadDisconnectedVertexes(std::shared_ptr<GeomAPI_Shape> theShape, const std::string& theName,int&  theTag) = 0;
102
103 protected:
104 };
105
106 //! Pointer on feature object
107 typedef std::shared_ptr<ModelAPI_ResultBody> ResultBodyPtr;
108
109 #endif