Salome HOME
Multiple fixes (issue #1757 , issue #1799 , issue #1842 , etc):
[modules/shaper.git] / src / FeaturesPlugin / FeaturesPlugin_Partition.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
2
3 // File:        FeaturesPlugin_Partition.h
4 // Created:     31 Jul 2015
5 // Author:      Natalia ERMOLAEVA
6
7 #ifndef FeaturesPlugin_Partition_H_
8 #define FeaturesPlugin_Partition_H_
9
10 #include "FeaturesPlugin.h"
11 #include <ModelAPI_Feature.h>
12
13 #include <GeomAlgoAPI_Partition.h>
14
15 /// \class FeaturesPlugin_Partition
16 /// \ingroup Plugins
17 /// \brief Feature for applying of Partition operations on Shapes. Partition makes conjunctional
18 /// faces of solids as shared. The result of partitions is a compsolid.
19 class FeaturesPlugin_Partition : public ModelAPI_Feature
20 {
21 public:
22   /// Feature kind.
23   inline static const std::string& ID()
24   {
25     static const std::string MY_ID("Partition");
26     return MY_ID;
27   }
28
29   /// Attribute name of base objects.
30   inline static const std::string& BASE_OBJECTS_ID()
31   {
32     static const std::string MY_BASE_OBJECTS_ID("base_objects");
33     return MY_BASE_OBJECTS_ID;
34   }
35
36   /// \return the kind of a feature.
37   FEATURESPLUGIN_EXPORT virtual const std::string& getKind()
38   {
39     static std::string MY_KIND = FeaturesPlugin_Partition::ID();
40     return MY_KIND;
41   }
42
43   /// Creates a new part document if needed
44   FEATURESPLUGIN_EXPORT virtual void execute();
45
46   /// Request for initialization of data model of the feature: adding all attributes
47   FEATURESPLUGIN_EXPORT virtual void initAttributes();
48
49   /// Use plugin manager for features creation
50   FeaturesPlugin_Partition();
51
52 private:
53   /// Stores result of generation.
54   void storeResult(ListOfShape& theObjects,
55                    ListOfShape& thePlanes,
56                    const GeomShapePtr theResultShape,
57                    const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape,
58                    const int theIndex = 0);
59 };
60
61 #endif