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 * \param[in] theType type of the operation: Fuse, Cut, Common
45 * \return a solid as result of operation
47 GEOMALGOAPI_EXPORT static std::shared_ptr<GeomAPI_Shape> makeCommon(
48 std::shared_ptr<GeomAPI_Shape> theObject,
49 std::shared_ptr<GeomAPI_Shape> theTool);
57 GEOMALGOAPI_EXPORT GeomAlgoAPI_Boolean (std::shared_ptr<GeomAPI_Shape> theObject,
58 std::shared_ptr<GeomAPI_Shape> theTool,
61 /// Returns True if algorithm succeed
62 GEOMALGOAPI_EXPORT const bool isDone() const;
64 /// Returns True if resulting shape is valid
65 GEOMALGOAPI_EXPORT const bool isValid() const;
67 /// Returns result of the boolean algorithm which may be a Solid or a Face
68 GEOMALGOAPI_EXPORT const std::shared_ptr<GeomAPI_Shape>& shape () const;
70 /// Returns map of sub-shapes of the result. To be used for History keeping
71 GEOMALGOAPI_EXPORT void mapOfShapes (GeomAPI_DataMapOfShapeShape& theMap) const;
73 /// Return interface for for History processing
74 GEOMALGOAPI_EXPORT GeomAlgoAPI_MakeShape* makeShape () const;
77 GEOMALGOAPI_EXPORT ~GeomAlgoAPI_Boolean();
80 /// builds resulting shape
81 void build(std::shared_ptr<GeomAPI_Shape> theObject,
82 std::shared_ptr<GeomAPI_Shape> theTool);
87 std::shared_ptr<GeomAPI_Shape> myShape;
88 GeomAPI_DataMapOfShapeShape myMap;
89 GeomAlgoAPI_MakeShape * myMkShape;