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 /// Stores the shape without naming support
42 virtual void storeWithoutNaming(const std::shared_ptr<GeomAPI_Shape>& theShape) = 0;
44 /// Returns the shape-result produced by this feature
45 virtual std::shared_ptr<GeomAPI_Shape> shape() = 0;
47 /// Records the subshape newShape which was generated during a topological construction.
48 /// As an example, consider the case of a face generated in construction of a box.
49 virtual void generated(
50 const std::shared_ptr<GeomAPI_Shape>& theNewShape, const std::string& theName, const int theTag = 1) = 0;
52 /// Records the shape newShape which was generated from the shape oldShape during a topological
53 /// construction. As an example, consider the case of a face generated from an edge in
54 /// construction of a prism.
55 virtual void generated(const std::shared_ptr<GeomAPI_Shape>& theOldShape,
56 const std::shared_ptr<GeomAPI_Shape>& theNewShape, const std::string& theName, const int theTag = 1) = 0;
58 /// Records the shape newShape which is a modification of the shape oldShape.
59 /// As an example, consider the case of a face split or merged in a Boolean operation.
60 virtual void modified(const std::shared_ptr<GeomAPI_Shape>& theOldShape,
61 const std::shared_ptr<GeomAPI_Shape>& theNewShape, const std::string& theName, const int theTag = 1) = 0;
63 /// Records the shape oldShape which was deleted from the current label.
64 /// As an example, consider the case of a face removed by a Boolean operation.
66 const std::shared_ptr<GeomAPI_Shape>& theOldShape, const int theTag = 1) = 0;
68 /// load deleted shapes
69 virtual void loadDeletedShapes (GeomAlgoAPI_MakeShape* theMS,
70 std::shared_ptr<GeomAPI_Shape> theShapeIn,
71 const int theKindOfShape,
72 const int theTag) = 0;
73 /// load and orient modified shapes
74 virtual void loadAndOrientModifiedShapes (
75 GeomAlgoAPI_MakeShape* theMS,
76 std::shared_ptr<GeomAPI_Shape> theShapeIn,
77 const int theKindOfShape,
79 const std::string& theName,
80 GeomAPI_DataMapOfShapeShape& theSubShapes) = 0;
81 /// load and orient generated shapes
82 virtual void loadAndOrientGeneratedShapes (
83 GeomAlgoAPI_MakeShape* theMS,
84 std::shared_ptr<GeomAPI_Shape> theShapeIn,
85 const int theKindOfShape,
87 const std::string& theName,
88 GeomAPI_DataMapOfShapeShape& theSubShapes) = 0;
90 /// load shapes of the first level (to be used during shape import)
91 virtual void loadFirstLevel(std::shared_ptr<GeomAPI_Shape> theShape, const std::string& theName, int& theTag) = 0;
93 /// load disconnected edges
94 virtual void loadDisconnectedEdges(std::shared_ptr<GeomAPI_Shape> theShape, const std::string& theName, int& theTag) = 0;
96 /// load disconnected vetexes
97 virtual void loadDisconnectedVertexes(std::shared_ptr<GeomAPI_Shape> theShape, const std::string& theName,int& theTag) = 0;
99 /// Converts evolution of sub-shapes stored in naming structure to selection
100 /// (theFlag = true) and back (theFlag = false)
101 virtual void evolutionToSelection(const bool theFlag) = 0;
104 /// Returns the data manager of this object: attributes
105 MODELAPI_EXPORT virtual std::shared_ptr<ModelAPI_Data> data() const;
107 /// Returns document this feature belongs to
108 MODELAPI_EXPORT virtual std::shared_ptr<ModelAPI_Document> document() const;
111 MODELAPI_EXPORT ModelAPI_BodyBuilder(ModelAPI_Object* theOwner);
113 ModelAPI_Object* myOwner;
116 //! Pointer on feature object
117 typedef std::shared_ptr<ModelAPI_BodyBuilder> BodyBuilderPtr;