1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: ModelAPI_BodyBuilder.hxx
4 // Created: 07 Jul 2014
5 // Author: Mikhail PONIKAROV
7 #ifndef ModelAPI_BodyBuilder_H_
8 #define ModelAPI_BodyBuilder_H_
11 #include <GeomAPI_Shape.h>
12 #include <GeomAlgoAPI_MakeShape.h>
13 #include <GeomAPI_DataMapOfShapeShape.h>
18 class ModelAPI_Document;
19 class ModelAPI_Object;
21 /**\class ModelAPI_BodyBuilder
24 class ModelAPI_BodyBuilder
27 MODELAPI_EXPORT virtual ~ModelAPI_BodyBuilder() {};
29 /// Stores the shape (called by the execution method).
30 virtual void store(const std::shared_ptr<GeomAPI_Shape>& theShape) = 0;
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;
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;
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;
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;
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;
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.
60 const std::shared_ptr<GeomAPI_Shape>& theOldShape, const int theTag = 1) = 0;
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,
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,
81 const std::string& theName,
82 GeomAPI_DataMapOfShapeShape& theSubShapes) = 0;
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;
87 /// load disconnected edges
88 virtual void loadDisconnectedEdges(std::shared_ptr<GeomAPI_Shape> theShape, const std::string& theName, int& theTag) = 0;
90 /// load disconnected vetexes
91 virtual void loadDisconnectedVertexes(std::shared_ptr<GeomAPI_Shape> theShape, const std::string& theName,int& theTag) = 0;
94 /// Returns the data manager of this object: attributes
95 MODELAPI_EXPORT virtual std::shared_ptr<ModelAPI_Data> data() const;
97 /// Returns document this feature belongs to
98 MODELAPI_EXPORT virtual std::shared_ptr<ModelAPI_Document> document() const;
101 MODELAPI_EXPORT ModelAPI_BodyBuilder(ModelAPI_Object* theOwner);
103 ModelAPI_Object* myOwner;
106 //! Pointer on feature object
107 typedef std::shared_ptr<ModelAPI_BodyBuilder> BodyBuilderPtr;