20 #ifndef Model_BodyBuilder_H_
21 #define Model_BodyBuilder_H_
24 #include <ModelAPI_BodyBuilder.h>
26 #include <GeomAlgoAPI_MakeShape.h>
27 #include <GeomAPI_DataMapOfShapeShape.h>
30 class TNaming_Builder;
40 std::map<int, TNaming_Builder*> myBuilders;
43 MODEL_EXPORT
virtual void store(
const GeomShapePtr& theShape,
44 const bool theIsStoreSameShapes =
true)
override;
47 MODEL_EXPORT
virtual void storeGenerated(
const GeomShapePtr& theFromShape,
48 const GeomShapePtr& theToShape,
49 const bool theIsCleanStored =
true)
override;
52 MODEL_EXPORT
virtual void storeGenerated(
const std::list<GeomShapePtr>& theFromShapes,
53 const GeomShapePtr& theToShape,
54 const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape)
override;
60 MODEL_EXPORT
virtual void storeModified(
const GeomShapePtr& theOldShape,
61 const GeomShapePtr& theNewShape,
62 const bool theIsCleanStored =
true)
override;
68 MODEL_EXPORT
virtual void storeModified(
const std::list<GeomShapePtr>& theOldShapes,
69 const GeomShapePtr& theNewShape,
70 const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape)
override;
73 MODEL_EXPORT
virtual GeomShapePtr
shape();
78 MODEL_EXPORT
virtual bool generated(
const GeomShapePtr& theNewShape,
79 const std::string& theName,
const bool theCheckIsInResult =
true)
override;
84 MODEL_EXPORT
virtual void generated(
const GeomShapePtr& theOldShape,
85 const GeomShapePtr& theNewShape,
86 const std::string& theName =
"")
override;
91 MODEL_EXPORT
virtual void modified(
const GeomShapePtr& theOldShape,
92 const GeomShapePtr& theNewShape,
93 const std::string& theName =
"")
override;
98 const GeomShapePtr& theOldShape,
100 const GeomShapePtr& theShapesToExclude = GeomShapePtr())
override;
105 const GeomShapePtr& theOldShape,
107 const std::string& theName =
"")
override;
112 const GeomShapePtr& theOldShape,
114 const std::string& theName =
"",
115 const bool theSaveOldIfNotInTree =
false)
override;
119 const std::string& theName)
override;
125 MODEL_EXPORT
virtual void cleanCash()
override;
134 TNaming_Builder*
builder(
const int theTag);
138 void loadNextLevels(GeomShapePtr theShape,
139 const std::string& theName);
142 void buildName(
const int theTag,
const std::string& theName);
147 std::vector<int> tags;
151 int myFreePrimitiveTag;
152 std::map<std::string, IndexTags> myPrimitivesNamesIndexMap;
156 friend class Model_ResultCompSolid;
ShapeType
Shape type enum.
Definition: GeomAPI_Shape.h:46
Extra API for the ResultBody that allows to work with naming.
Definition: ModelAPI_BodyBuilder.h:39
Represents any object in the data model and in the object browser.
Definition: ModelAPI_Object.h:45
Extra API for the ResultBody that allows to work with naming.
Definition: Model_BodyBuilder.h:37
virtual ~Model_BodyBuilder()
Removes the stored builders.
Definition: Model_BodyBuilder.cpp:463
Model_BodyBuilder(ModelAPI_Object *theOwner)
Default constructor accessible only by Model_Objects.
Definition: Model_BodyBuilder.cpp:120
virtual void store(const GeomShapePtr &theShape, const bool theIsStoreSameShapes=true) override
Stores the shape (called by the execution method).
Definition: Model_BodyBuilder.cpp:173
virtual void loadFirstLevel(GeomShapePtr theShape, const std::string &theName) override
Loads shapes of the first level (to be used during shape import)
Definition: Model_BodyBuilder.cpp:964
virtual void modified(const GeomShapePtr &theOldShape, const GeomShapePtr &theNewShape, const std::string &theName="") override
Records the shape newShape which is a modification of the shape oldShape.
Definition: Model_BodyBuilder.cpp:545
virtual void cleanCash() override
Cleans cash related to the already stored elements.
Definition: Model_BodyBuilder.cpp:458
virtual void loadModifiedShapes(const GeomMakeShapePtr &theAlgo, const GeomShapePtr &theOldShape, const GeomAPI_Shape::ShapeType theShapeTypeToExplore, const std::string &theName="") override
load and orient modified shapes
Definition: Model_BodyBuilder.cpp:622
virtual void storeGenerated(const GeomShapePtr &theFromShape, const GeomShapePtr &theToShape, const bool theIsCleanStored=true) override
Stores the generated shape (called by the execution method).
Definition: Model_BodyBuilder.cpp:220
virtual void storeModified(const GeomShapePtr &theOldShape, const GeomShapePtr &theNewShape, const bool theIsCleanStored=true) override
Stores the modified shape (called by the execution method).
Definition: Model_BodyBuilder.cpp:317
void clean()
Removes the stored builders.
Definition: Model_BodyBuilder.cpp:435
virtual GeomShapePtr shape()
Returns the shape-result produced by this feature.
Definition: Model_BodyBuilder.cpp:1010
virtual void loadGeneratedShapes(const GeomMakeShapePtr &theAlgo, const GeomShapePtr &theOldShape, const GeomAPI_Shape::ShapeType theShapeTypeToExplore, const std::string &theName="", const bool theSaveOldIfNotInTree=false) override
load and orient generated shapes
Definition: Model_BodyBuilder.cpp:692
TNaming_Builder * builder(const int theTag)
Returns (creates if necessary) the builder created on the needed tag of sub-label.
Definition: Model_BodyBuilder.cpp:307
virtual bool generated(const GeomShapePtr &theNewShape, const std::string &theName, const bool theCheckIsInResult=true) override
Records the subshape newShape which was generated during a topological construction.
Definition: Model_BodyBuilder.cpp:484
virtual void loadDeletedShapes(const GeomMakeShapePtr &theAlgo, const GeomShapePtr &theOldShape, const GeomAPI_Shape::ShapeType theShapeTypeToExplore, const GeomShapePtr &theShapesToExclude=GeomShapePtr()) override
load deleted shapes
Definition: Model_BodyBuilder.cpp:557
The body (shape) result of a feature.
Definition: Model_ResultBody.h:40