20 #ifndef GeomAlgoAPI_MakeShape_H_
21 #define GeomAlgoAPI_MakeShape_H_
23 #include <GeomAlgoAPI.h>
24 #include <GeomAPI_DataMapOfShapeShape.h>
40 OCCT_BRepBuilderAPI_MakeShape,
42 OCCT_BRepOffset_MakeOffset
57 const BuilderType theBuilderType = OCCT_BRepBuilderAPI_MakeShape)
59 myBuilderType(theBuilderType)
69 const BuilderType theBuilderType = OCCT_BRepBuilderAPI_MakeShape)
72 myBuilderType = theBuilderType;
77 GEOMALGOAPI_EXPORT
virtual void build() {}
80 GEOMALGOAPI_EXPORT
bool isDone()
const;
83 GEOMALGOAPI_EXPORT
virtual const GeomShapePtr
shape()
const;
86 GEOMALGOAPI_EXPORT
bool isValid()
const;
89 GEOMALGOAPI_EXPORT std::shared_ptr<GeomAPI_DataMapOfShapeShape>
mapOfSubShapes()
const;
94 GEOMALGOAPI_EXPORT
virtual void generated(
const GeomShapePtr theOldShape,
95 ListOfShape& theNewShapes);
101 GEOMALGOAPI_EXPORT
virtual void modified(
const GeomShapePtr theOldShape,
102 ListOfShape& theNewShapes);
109 GEOMALGOAPI_EXPORT
void modifiedCached(
const GeomShapePtr theOldShape,
110 ListOfShape& theNewShapes);
114 GEOMALGOAPI_EXPORT
virtual bool isDeleted(
const GeomShapePtr theOldShape);
117 GEOMALGOAPI_EXPORT
virtual bool check() {
return true; };
131 GEOMALGOAPI_EXPORT
bool checkValid(std::string theMessage);
138 const int theShapeType);
145 const int theShapeType);
151 const int theShapeType);
158 GEOMALGOAPI_EXPORT GeomShapePtr
oldShapesForNew(GeomShapePtr theWholeOld,
159 GeomShapePtr theNewShape,
160 const int theShapeType);
172 GEOMALGOAPI_EXPORT
void setDone(
const bool theFlag);
176 GEOMALGOAPI_EXPORT
void setShape(
const GeomShapePtr theShape);
183 std::shared_ptr<GeomAPI_DataMapOfShapeShape>
myMap;
196 GeomShapePtr myShape;
207 typedef std::shared_ptr<GeomAlgoAPI_MakeShape> GeomMakeShapePtr;
208 typedef std::list<GeomMakeShapePtr> ListOfMakeShape;
General base class for all interfaces in this package.
Definition: GeomAPI_Interface.h:38
void setImpl(T *theImpl)
Updates the impl (deletes the old one)
Definition: GeomAPI_Interface.h:71
Interface to the root class of all topological shapes constructions.
Definition: GeomAlgoAPI_MakeShape.h:35
virtual GEOMALGOAPI_EXPORT void generated(const GeomShapePtr theOldShape, ListOfShape &theNewShapes)
Definition: GeomAlgoAPI_MakeShape.cpp:96
GEOMALGOAPI_EXPORT void cleanNewShapes(GeomShapePtr theWholeOld, const int theShapeType)
Clean cached data, created by collectNewShapes() method, called with the same arguments.
Definition: GeomAlgoAPI_MakeShape.cpp:390
virtual GEOMALGOAPI_EXPORT const GeomShapePtr shape() const
Definition: GeomAlgoAPI_MakeShape.cpp:77
GEOMALGOAPI_EXPORT void setBuilderType(const BuilderType theBuilderType)
Sets builder type.
Definition: GeomAlgoAPI_MakeShape.cpp:185
BuilderType
Builder type enum.
Definition: GeomAlgoAPI_MakeShape.h:38
GEOMALGOAPI_EXPORT std::shared_ptr< GeomAPI_DataMapOfShapeShape > mapOfSubShapes() const
Definition: GeomAlgoAPI_MakeShape.cpp:90
GEOMALGOAPI_EXPORT ~GeomAlgoAPI_MakeShape()
Destructor for remove myHist.
Definition: GeomAlgoAPI_MakeShape.cpp:60
bool isValidForHistory(const GeomShapePtr theShape)
Definition: GeomAlgoAPI_MakeShape.cpp:237
GEOMALGOAPI_EXPORT GeomShapePtr oldShapesForNew(GeomShapePtr theWholeOld, GeomShapePtr theNewShape, const int theShapeType)
Optimization of access the new shapes by old shapes for the limited set of needed new shapes.
Definition: GeomAlgoAPI_MakeShape.cpp:428
std::string myError
Error occurred during the execution of an algorithm.
Definition: GeomAlgoAPI_MakeShape.h:185
GEOMALGOAPI_EXPORT void setShape(const GeomShapePtr theShape)
Sets result shape.
Definition: GeomAlgoAPI_MakeShape.cpp:197
GEOMALGOAPI_EXPORT void setDone(const bool theFlag)
Sets status of builder.
Definition: GeomAlgoAPI_MakeShape.cpp:191
std::map< std::string, GeomShapePtr > myCreatedFaces
Map of created faces with their name for naming.
Definition: GeomAlgoAPI_MakeShape.h:187
void initialize(T *theBuilder, const BuilderType theBuilderType=OCCT_BRepBuilderAPI_MakeShape)
Initializes internals.
Definition: GeomAlgoAPI_MakeShape.h:67
virtual GEOMALGOAPI_EXPORT bool check()
Definition: GeomAlgoAPI_MakeShape.h:117
virtual GEOMALGOAPI_EXPORT void build()
Execute the algorithm.
Definition: GeomAlgoAPI_MakeShape.h:77
GEOMALGOAPI_EXPORT bool isValid() const
Definition: GeomAlgoAPI_MakeShape.cpp:83
virtual GEOMALGOAPI_EXPORT void modified(const GeomShapePtr theOldShape, ListOfShape &theNewShapes)
Get a list of new shapes, modified from the given old shape.
Definition: GeomAlgoAPI_MakeShape.cpp:120
GEOMALGOAPI_EXPORT GeomAlgoAPI_MakeShape()
Empty constructor.
Definition: GeomAlgoAPI_MakeShape.cpp:51
GEOMALGOAPI_EXPORT bool isNewShapesCollected(GeomShapePtr theWholeOld, const int theShapeType)
Optimization of access the new shapes by old shapes for the limited set of needed new shapes.
Definition: GeomAlgoAPI_MakeShape.cpp:337
GEOMALGOAPI_EXPORT std::map< std::string, GeomShapePtr > getCreatedFaces()
Definition: GeomAlgoAPI_MakeShape.h:123
GEOMALGOAPI_EXPORT void collectNewShapes(GeomShapePtr theWholeOld, const int theShapeType)
Optimization of access the new shapes by old shapes for the limited set of needed new shapes.
Definition: GeomAlgoAPI_MakeShape.cpp:348
GEOMALGOAPI_EXPORT std::string getError()
Definition: GeomAlgoAPI_MakeShape.h:128
virtual GEOMALGOAPI_EXPORT bool isDeleted(const GeomShapePtr theOldShape)
Definition: GeomAlgoAPI_MakeShape.cpp:167
std::shared_ptr< GeomAPI_DataMapOfShapeShape > myMap
Data map to keep correct orientation of sub-shapes.
Definition: GeomAlgoAPI_MakeShape.h:183
GEOMALGOAPI_EXPORT void modifiedCached(const GeomShapePtr theOldShape, ListOfShape &theNewShapes)
Get a list of new shapes, modified from the given old shape.
Definition: GeomAlgoAPI_MakeShape.cpp:150
GEOMALGOAPI_EXPORT bool checkValid(std::string theMessage)
Check the validity of the produced shape.
Definition: GeomAlgoAPI_MakeShape.cpp:312
virtual GEOMALGOAPI_EXPORT void prepareNamingFaces()
Prepare the naming of faces.
Definition: GeomAlgoAPI_MakeShape.cpp:301
GeomAlgoAPI_MakeShape(T *theBuilder, const BuilderType theBuilderType=OCCT_BRepBuilderAPI_MakeShape)
Constructor by builder and builder type.
Definition: GeomAlgoAPI_MakeShape.h:55
GEOMALGOAPI_EXPORT bool isDone() const
Definition: GeomAlgoAPI_MakeShape.cpp:71
GEOMALGOAPI_EXPORT void fixOrientation(GeomShapePtr &theShape)
Replaces theShape with shape from myMap.
Definition: GeomAlgoAPI_MakeShape.cpp:253