1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: GeomAlgoAPI_Boolean.h
4 // Created: 02 Sept 2014
5 // Author: Vitaly Smetannikov
7 #ifndef GeomAlgoAPI_Boolean_H_
8 #define GeomAlgoAPI_Boolean_H_
10 #include <GeomAlgoAPI.h>
11 #include <GeomAPI_Shape.h>
12 #include <GeomAlgoAPI_MakeShape.h>
13 #include <GeomAPI_DataMapOfShapeShape.h>
16 /**\class GeomAlgoAPI_Boolean
18 * \brief Allows to perform of boolean operations
20 class GeomAlgoAPI_Boolean : public GeomAPI_Interface
23 /**\brief Creates cut boolean operation
24 * \param[in] theShape the main shape
25 * \param[in] theTool toole shape for boolean
26 * \return a solid as result of operation
28 GEOMALGOAPI_EXPORT static std::shared_ptr<GeomAPI_Shape> makeCut(
29 std::shared_ptr<GeomAPI_Shape> theShape,
30 std::shared_ptr<GeomAPI_Shape> theTool);
32 /**\brief Creates fuse boolean operation
33 * \param[in] theShape the main shape
34 * \param[in] theTool second shape
35 * \return a solid as result of operation
37 GEOMALGOAPI_EXPORT static std::shared_ptr<GeomAPI_Shape> makeFuse(
38 std::shared_ptr<GeomAPI_Shape> theShape,
39 std::shared_ptr<GeomAPI_Shape> theTool);
41 /**\brief Creates common boolean operation
42 * \param[in] theObject the main shape
43 * \param[in] theTool second shape
44 * \return a solid as result of operation
46 GEOMALGOAPI_EXPORT static std::shared_ptr<GeomAPI_Shape> makeCommon(
47 std::shared_ptr<GeomAPI_Shape> theObject,
48 std::shared_ptr<GeomAPI_Shape> theTool);
56 GEOMALGOAPI_EXPORT GeomAlgoAPI_Boolean (std::shared_ptr<GeomAPI_Shape> theObject,
57 std::shared_ptr<GeomAPI_Shape> theTool,
60 /// Returns True if algorithm succeed
61 GEOMALGOAPI_EXPORT const bool isDone() const;
63 /// Returns True if resulting shape is valid
64 GEOMALGOAPI_EXPORT const bool isValid() const;
66 /// Returns result of the boolean algorithm which may be a Solid or a Face
67 GEOMALGOAPI_EXPORT const std::shared_ptr<GeomAPI_Shape>& shape () const;
69 /// Returns map of sub-shapes of the result. To be used for History keeping
70 GEOMALGOAPI_EXPORT void mapOfShapes (GeomAPI_DataMapOfShapeShape& theMap) const;
72 /// Return interface for for History processing
73 GEOMALGOAPI_EXPORT GeomAlgoAPI_MakeShape* makeShape () const;
76 GEOMALGOAPI_EXPORT ~GeomAlgoAPI_Boolean();
79 /// builds resulting shape
80 void build(std::shared_ptr<GeomAPI_Shape> theObject,
81 std::shared_ptr<GeomAPI_Shape> theTool);
86 std::shared_ptr<GeomAPI_Shape> myShape;
87 GeomAPI_DataMapOfShapeShape myMap;
88 GeomAlgoAPI_MakeShape * myMkShape;