1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: GeomAlgoAPI_Partition.h
4 // Created: 21 Aug 2015
5 // Author: Sergey POKHODENKO
7 #ifndef GeomAlgoAPI_Partition_H_
8 #define GeomAlgoAPI_Partition_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_Partition
21 * \brief Allows to perform of partition operations
23 class GeomAlgoAPI_Partition : public GeomAPI_Interface
26 /** \brief Creates common partition operation.
27 * \param[in] theObjects the main shape.
28 * \param[in] theTools second shape.
29 * \return a solid as result of operation.
31 GEOMALGOAPI_EXPORT static std::shared_ptr<GeomAPI_Shape> make(const ListOfShape& theObjects,
32 const ListOfShape& theTools);
35 GEOMALGOAPI_EXPORT GeomAlgoAPI_Partition(const ListOfShape& theObjects,
36 const ListOfShape& theTools);
38 /// \return true if algorithm succeed.
39 GEOMALGOAPI_EXPORT const bool isDone() const;
41 /// \return true if resulting shape is valid.
42 GEOMALGOAPI_EXPORT const bool isValid() const;
44 /// \return result of the boolean algorithm.
45 GEOMALGOAPI_EXPORT const std::shared_ptr<GeomAPI_Shape>& shape() const;
47 /// \return map of sub-shapes of the result. To be used for History keeping.
48 GEOMALGOAPI_EXPORT std::shared_ptr<GeomAPI_DataMapOfShapeShape> mapOfShapes() const;
50 /// \return interface for for History processing.
51 GEOMALGOAPI_EXPORT std::shared_ptr<GeomAlgoAPI_MakeShape> makeShape() const;
54 /// Builds resulting shape.
55 void build(const ListOfShape& theObjects,
56 const ListOfShape& theTools);
61 std::shared_ptr<GeomAPI_Shape> myShape;
62 std::shared_ptr<GeomAPI_DataMapOfShapeShape> myMap;
63 std::shared_ptr<GeomAlgoAPI_MakeShape> myMkShape;