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
33 /** \brief Creates cut boolean operation.
34 * \param[in] theObjects the main shape.
35 * \param[in] theTools toole shape for boolean.
36 * \return a solid or compound of solids as result of operation.
38 GEOMALGOAPI_EXPORT static std::shared_ptr<GeomAPI_Shape> makeCut(const ListOfShape& theObjects,
39 const ListOfShape& theTools);
41 /** \brief Creates fuse boolean operation.
42 * \param[in] theObjects the main shape.
43 * \param[in] theTools second shape.
44 * \return a solid as result of operation.
46 GEOMALGOAPI_EXPORT static std::shared_ptr<GeomAPI_Shape> makeFuse(const ListOfShape& theObjects,
47 const ListOfShape& theTools);
49 /** \brief Creates common boolean operation.
50 * \param[in] theObjects the main shape.
51 * \param[in] theTools second shape.
52 * \return a solid as result of operation.
54 GEOMALGOAPI_EXPORT static std::shared_ptr<GeomAPI_Shape> makeCommon(const ListOfShape& theObjects,
55 const ListOfShape& theTools);
58 GEOMALGOAPI_EXPORT GeomAlgoAPI_Boolean(const ListOfShape& theObjects,
59 const ListOfShape& theTools,
60 const OperationType theOperationType);
62 /// \return true if algorithm succeed.
63 GEOMALGOAPI_EXPORT const bool isDone() const;
65 /// \return true if resulting shape is valid.
66 GEOMALGOAPI_EXPORT const bool isValid() const;
68 /// \return result of the boolean algorithm.
69 GEOMALGOAPI_EXPORT const std::shared_ptr<GeomAPI_Shape>& shape() const;
71 /// \return map of sub-shapes of the result. To be used for History keeping.
72 GEOMALGOAPI_EXPORT std::shared_ptr<GeomAPI_DataMapOfShapeShape> mapOfShapes() const;
74 /// \return interface for for History processing.
75 GEOMALGOAPI_EXPORT std::shared_ptr<GeomAlgoAPI_MakeShape> makeShape() const;
78 /// Builds resulting shape.
79 void build(const ListOfShape& theObjects,
80 const ListOfShape& theTools,
81 const OperationType theOperationType);
86 std::shared_ptr<GeomAPI_Shape> myShape;
87 std::shared_ptr<GeomAPI_DataMapOfShapeShape> myMap;
88 std::shared_ptr<GeomAlgoAPI_MakeShape> myMkShape;