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 <GeomAlgoAPI_MakeShape.h>
13 #include <GeomAPI_Shape.h>
14 #include <GeomAPI_Interface.h>
15 #include <GeomAPI_DataMapOfShapeShape.h>
19 /**\class GeomAlgoAPI_Boolean
21 * \brief Allows to perform of boolean operations
23 class GeomAlgoAPI_Boolean : public GeomAPI_Interface
26 /**\brief Creates cut boolean operation
27 * \param[in] theShape the main shape
28 * \param[in] theTool toole shape for boolean
29 * \return a solid as result of operation
31 GEOMALGOAPI_EXPORT static std::shared_ptr<GeomAPI_Shape> makeCut(
32 std::shared_ptr<GeomAPI_Shape> theShape,
33 std::shared_ptr<GeomAPI_Shape> theTool);
35 /**\brief Creates fuse boolean operation
36 * \param[in] theShape the main shape
37 * \param[in] theTool second shape
38 * \return a solid as result of operation
40 GEOMALGOAPI_EXPORT static std::shared_ptr<GeomAPI_Shape> makeFuse(
41 std::shared_ptr<GeomAPI_Shape> theShape,
42 std::shared_ptr<GeomAPI_Shape> theTool);
44 /**\brief Creates common boolean operation
45 * \param[in] theObject the main shape
46 * \param[in] theTool second shape
47 * \return a solid as result of operation
49 GEOMALGOAPI_EXPORT static std::shared_ptr<GeomAPI_Shape> makeCommon(
50 std::shared_ptr<GeomAPI_Shape> theObject,
51 std::shared_ptr<GeomAPI_Shape> theTool);
59 GEOMALGOAPI_EXPORT GeomAlgoAPI_Boolean (std::shared_ptr<GeomAPI_Shape> theObject,
60 std::shared_ptr<GeomAPI_Shape> theTool,
63 /// Returns True if algorithm succeed
64 GEOMALGOAPI_EXPORT const bool isDone() const;
66 /// Returns True if resulting shape is valid
67 GEOMALGOAPI_EXPORT const bool isValid() const;
69 /// Returns result of the boolean algorithm which may be a Solid or a Face
70 GEOMALGOAPI_EXPORT const std::shared_ptr<GeomAPI_Shape>& shape () const;
72 /// Returns map of sub-shapes of the result. To be used for History keeping
73 GEOMALGOAPI_EXPORT void mapOfShapes(std::shared_ptr<GeomAPI_DataMapOfShapeShape>& theMap) const;
75 /// Return interface for for History processing
76 GEOMALGOAPI_EXPORT const std::shared_ptr<GeomAlgoAPI_MakeShape>& makeShape () const;
79 GEOMALGOAPI_EXPORT ~GeomAlgoAPI_Boolean();
82 /// builds resulting shape
83 void build(std::shared_ptr<GeomAPI_Shape> theObject,
84 std::shared_ptr<GeomAPI_Shape> theTool);
89 std::shared_ptr<GeomAPI_Shape> myShape;
90 std::shared_ptr<GeomAPI_DataMapOfShapeShape> myMap;
91 std::shared_ptr<GeomAlgoAPI_MakeShape> myMkShape;