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 /// Type of booelan operation
28 BOOL_CUT, ///< Cut objects
29 BOOL_FUSE, ///< Fuse objects
30 BOOL_COMMON ///< Take common part of objects
36 GEOMALGOAPI_EXPORT GeomAlgoAPI_Boolean(const ListOfShape& theObjects,
37 const ListOfShape& theTools,
38 const OperationType theOperationType);
40 /// \return true if algorithm succeed.
41 GEOMALGOAPI_EXPORT const bool isDone() const;
43 /// \return true if resulting shape is valid.
44 GEOMALGOAPI_EXPORT const bool isValid() const;
46 /// \return result of the boolean algorithm.
47 GEOMALGOAPI_EXPORT const std::shared_ptr<GeomAPI_Shape>& shape() const;
49 /// \return map of sub-shapes of the result. To be used for History keeping.
50 GEOMALGOAPI_EXPORT std::shared_ptr<GeomAPI_DataMapOfShapeShape> mapOfShapes() const;
52 /// \return interface for for History processing.
53 GEOMALGOAPI_EXPORT std::shared_ptr<GeomAlgoAPI_MakeShape> makeShape() const;
56 /// Builds resulting shape.
57 void build(const ListOfShape& theObjects,
58 const ListOfShape& theTools,
59 const OperationType theOperationType);
64 std::shared_ptr<GeomAPI_Shape> myShape;
65 std::shared_ptr<GeomAPI_DataMapOfShapeShape> myMap;
66 std::shared_ptr<GeomAlgoAPI_MakeShape> myMkShape;