Salome HOME
Partition feature definition.
[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 /**\class FeaturesPlugin_Partition
14  * \ingroup Plugins
15  * \brief Feature for applying of Partition operations on Solids. Partition makes conjunctional
16  * faces of solids as shared. The result of partitions is a compsolid.
17  * Main objects are solids, tool objects are solids or faces
18  */
19 class FeaturesPlugin_Partition : public ModelAPI_Feature
20 {
21 public:
22   /// Extrusion kind
23   inline static const std::string& ID()
24   {
25     static const std::string MY_ID("Partition");
26     return MY_ID;
27   }
28   /// attribute name of referenced object
29   inline static const std::string& OBJECT_LIST_ID()
30   {
31     static const std::string MY_OBJECT_LIST_ID("main_objects");
32     return MY_OBJECT_LIST_ID;
33   }
34   /// attribute name of tool object
35   inline static const std::string& TOOL_LIST_ID()
36   {
37     static const std::string MY_TOOL_LIST_ID("tool_objects");
38     return MY_TOOL_LIST_ID;
39   }
40
41   /// Returns the kind of a feature
42   FEATURESPLUGIN_EXPORT virtual const std::string& getKind()
43   {
44     static std::string MY_KIND = FeaturesPlugin_Partition::ID();
45     return MY_KIND;
46   }
47
48   /// Creates a new part document if needed
49   FEATURESPLUGIN_EXPORT virtual void execute();
50
51   /// Request for initialization of data model of the feature: adding all attributes
52   FEATURESPLUGIN_EXPORT virtual void initAttributes();
53
54   /// Use plugin manager for features creation
55   FeaturesPlugin_Partition();
56
57 private:
58   std::shared_ptr<GeomAPI_Shape> getShape(const std::string& theAttrName);
59
60 };
61
62 #endif