]> SALOME platform Git repositories - modules/shaper.git/blob - src/ModelAPI/ModelAPI_BodyBuilder.h
Salome HOME
Result CompSolid should inherits ResultBody. All model realization concerned Naming...
[modules/shaper.git] / src / ModelAPI / ModelAPI_BodyBuilder.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        ModelAPI_BodyBuilder.hxx
4 // Created:     07 Jul 2014
5 // Author:      Mikhail PONIKAROV
6
7 #ifndef ModelAPI_BodyBuilder_H_
8 #define ModelAPI_BodyBuilder_H_
9
10 #include <ModelAPI.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_Data;
18 class ModelAPI_Document;
19 class ModelAPI_Object;
20
21 /**\class ModelAPI_BodyBuilder
22 * \ingroup DataModel
23 */
24 class ModelAPI_BodyBuilder
25 {
26 public:
27   MODELAPI_EXPORT virtual ~ModelAPI_BodyBuilder() {};
28
29   /// Stores the shape (called by the execution method).
30   virtual void store(const std::shared_ptr<GeomAPI_Shape>& theShape) = 0;
31
32   /// Stores the generated shape (called by the execution method).
33   virtual void storeGenerated(const std::shared_ptr<GeomAPI_Shape>& theFromShape,
34                                   const std::shared_ptr<GeomAPI_Shape>& theToShape) = 0;
35
36   /// Stores the modified shape (called by the execution method).
37   virtual void storeModified(const std::shared_ptr<GeomAPI_Shape>& theOldShape,
38                                   const std::shared_ptr<GeomAPI_Shape>& theNewShape,
39                             const int theDecomposeSolidsTag = 0) = 0;
40
41   /// Records the subshape newShape which was generated during a topological construction.
42   /// As an example, consider the case of a face generated in construction of a box.
43   virtual void generated(
44     const std::shared_ptr<GeomAPI_Shape>& theNewShape, const std::string& theName, const int theTag = 1) = 0;
45
46   /// Records the shape newShape which was generated from the shape oldShape during a topological 
47   /// construction. As an example, consider the case of a face generated from an edge in 
48   /// construction of a prism.
49   virtual void generated(const std::shared_ptr<GeomAPI_Shape>& theOldShape,
50     const std::shared_ptr<GeomAPI_Shape>& theNewShape, const std::string& theName, const int theTag = 1) = 0;
51
52   /// Records the shape newShape which is a modification of the shape oldShape.
53   /// As an example, consider the case of a face split or merged in a Boolean operation.
54   virtual void modified(const std::shared_ptr<GeomAPI_Shape>& theOldShape,
55     const std::shared_ptr<GeomAPI_Shape>& theNewShape, const std::string& theName, const int theTag = 1) = 0;
56
57   /// Records the shape oldShape which was deleted from the current label.
58   /// As an example, consider the case of a face removed by a Boolean operation.
59   virtual void deleted(
60     const std::shared_ptr<GeomAPI_Shape>& theOldShape, const int theTag = 1) = 0;
61   
62   /// load deleted shapes
63   virtual void loadDeletedShapes (GeomAlgoAPI_MakeShape* theMS,
64                                                std::shared_ptr<GeomAPI_Shape>  theShapeIn,
65                                                const int  theKindOfShape,
66                                                const int  theTag) = 0;
67   /// load and orient modified shapes
68   virtual void loadAndOrientModifiedShapes (
69                                                    GeomAlgoAPI_MakeShape* theMS,
70                                                std::shared_ptr<GeomAPI_Shape>  theShapeIn,
71                                                const int  theKindOfShape,
72                                                const int  theTag,
73                                                                                            const std::string& theName,
74                                                GeomAPI_DataMapOfShapeShape& theSubShapes) = 0;
75   /// load and orient generated shapes
76   virtual void loadAndOrientGeneratedShapes (
77                                                    GeomAlgoAPI_MakeShape* theMS,
78                                                std::shared_ptr<GeomAPI_Shape>  theShapeIn,
79                                                const int  theKindOfShape,
80                                                const int  theTag,
81                                                                                            const std::string& theName,
82                                                GeomAPI_DataMapOfShapeShape& theSubShapes) = 0;
83
84   /// load shapes of the first level (to be used during shape import)
85   virtual void loadFirstLevel(std::shared_ptr<GeomAPI_Shape> theShape, const std::string& theName, int&  theTag) = 0;
86   
87   /// load disconnected edges
88   virtual void loadDisconnectedEdges(std::shared_ptr<GeomAPI_Shape> theShape, const std::string& theName, int&  theTag) = 0;
89
90   /// load disconnected vetexes
91   virtual void loadDisconnectedVertexes(std::shared_ptr<GeomAPI_Shape> theShape, const std::string& theName,int&  theTag) = 0;
92
93 protected:
94   /// Returns the data manager of this object: attributes
95   MODELAPI_EXPORT virtual std::shared_ptr<ModelAPI_Data> data() const;
96
97   /// Returns document this feature belongs to
98   MODELAPI_EXPORT virtual std::shared_ptr<ModelAPI_Document> document() const;
99
100 protected:
101   MODELAPI_EXPORT ModelAPI_BodyBuilder(ModelAPI_Object* theOwner);
102
103   ModelAPI_Object* myOwner;
104 };
105
106 //! Pointer on feature object
107 typedef std::shared_ptr<ModelAPI_BodyBuilder> BodyBuilderPtr;
108
109 #endif