Salome HOME
#1118 Crash the SALOME application after export
[modules/shaper.git] / src / GeomAlgoAPI / GeomAlgoAPI_PaveFiller.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        GeomAlgoAPI_PaveFiller.h
4 // Created:     27 August 2015
5 // Author:      Dmitry Bobylev
6
7 #ifndef GeomAlgoAPI_PaveFiller_H_
8 #define GeomAlgoAPI_PaveFiller_H_
9
10 #include <GeomAlgoAPI.h>
11 #include <GeomAlgoAPI_MakeShape.h>
12
13 #include <GeomAPI_Shape.h>
14 #include <GeomAPI_Interface.h>
15 #include <GeomAPI_DataMapOfShapeShape.h>
16
17 /** \class GeomAlgoAPI_PaveFiller
18  *  \ingroup DataAlgo
19  *  \brief Finds the common parts from the list of shapes and breaks it to shapes with shared subshapes.
20  */
21 class GeomAlgoAPI_PaveFiller : public GeomAPI_Interface
22 {
23 public:
24   /** \brief Constructor.
25    *  \param[in] theListOfShape list of shape which should be splitted.
26    *  \param[in] theIsMakeCompSolids if true gather shapes with shared faces to compsolids.
27    */
28   GEOMALGOAPI_EXPORT GeomAlgoAPI_PaveFiller(const ListOfShape& theListOfShape, const bool theIsMakeCompSolids = false);
29
30   /// \return true if algorithm succeed.
31   GEOMALGOAPI_EXPORT const bool isDone() const;
32
33   /// \return true if resulting shape is valid.
34   GEOMALGOAPI_EXPORT const bool isValid() const;
35
36   /// \return result of the boolean algorithm.
37   GEOMALGOAPI_EXPORT std::shared_ptr<GeomAPI_Shape> shape() const;
38
39   /// \return map of sub-shapes of the result. To be used for History keeping.
40   GEOMALGOAPI_EXPORT std::shared_ptr<GeomAPI_DataMapOfShapeShape> mapOfShapes() const;
41
42   /// \return interface for for History processing.
43   GEOMALGOAPI_EXPORT std::shared_ptr<GeomAlgoAPI_MakeShape> makeShape() const;
44
45 private:
46   /// Builds resulting shape.
47   void build(const ListOfShape& theListOfShape, const bool theIsMakeCompSolids);
48
49 private:
50   /// Fields.
51   bool myDone;
52   std::shared_ptr<GeomAPI_Shape> myShape;
53   std::shared_ptr<GeomAPI_DataMapOfShapeShape> myMap;
54   std::shared_ptr<GeomAlgoAPI_MakeShape> myMkShape;
55 };
56
57 #endif