Salome HOME
50f82339a359872d68b1867a1c59ed9a22c7ea83
[modules/shaper.git] / src / FeaturesPlugin / FeaturesPlugin_Group.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
2
3 // File:        FeaturesPlugin_Group.h
4 // Created:     08 Oct 2014
5 // Author:      Sergey BELASH
6
7 #ifndef FEATURESPLUGIN_GROUP_H_
8 #define FEATURESPLUGIN_GROUP_H_
9
10 #include "FeaturesPlugin.h"
11 #include <ModelAPI_Feature.h>
12 #include <GeomAPI_Shape.h>
13
14 /**\class FeaturesPlugin_Group
15  * \ingroup Plugins
16  * \brief Feature for selection of sub-shapes of some shapes.
17  *
18  * All selected sub-shapes must be of equal type (vertex, edge, face, etc) but may
19  * be selected on different objects.
20  */
21 class FeaturesPlugin_Group : public ModelAPI_Feature
22 {
23  public:
24   /// Extrusion kind
25   inline static const std::string& ID()
26   {
27     static const std::string MY_GROUP_ID("Group");
28     return MY_GROUP_ID;
29   }
30   /// attribute name of selected entities list
31   inline static const std::string& LIST_ID()
32   {
33     static const std::string MY_GROUP_LIST_ID("group_list");
34     return MY_GROUP_LIST_ID;
35   }
36
37   /// Returns the kind of a feature
38   FEATURESPLUGIN_EXPORT virtual const std::string& getKind()
39   {
40     static std::string MY_KIND = FeaturesPlugin_Group::ID();
41     return MY_KIND;
42   }
43
44   /// Creates a new part document if needed
45   FEATURESPLUGIN_EXPORT virtual void execute();
46
47   /// Request for initialization of data model of the feature: adding all attributes
48   FEATURESPLUGIN_EXPORT virtual void initAttributes();
49
50   /// Result of groups is created on the fly and don't stored to the document
51   FEATURESPLUGIN_EXPORT virtual bool isPersistentResult() {return true;}
52
53   /// Use plugin manager for features creation
54   FeaturesPlugin_Group();
55
56 };
57
58 #endif