Salome HOME
Issue #1368: Creation of a Qt panel. Persistent mechanism.
[modules/shaper.git] / src / SamplePanelPlugin / SamplePanelPlugin_Feature.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
2
3 // File:        SamplePanelPlugin_Feature.h
4 // Created:     29 Mar 2015
5 // Author:      Natalia ERMOLAEVA
6
7 #ifndef SAMPLEPANELPLUGIN_FEATURE_H_
8 #define SAMPLEPANELPLUGIN_FEATURE_H_
9
10 #include "SamplePanelPlugin.h"
11
12 #include <ModelAPI_Feature.h>
13
14 /**\class SamplePanelPlugin_Feature
15  * \ingroup Plugins
16  * \brief Sample feature to be filled by the panel.
17  */
18 class SamplePanelPlugin_Feature : public ModelAPI_Feature
19 {
20  public:
21   /// SketchShape feature kind
22   inline static const std::string& ID()
23   {
24     static const std::string MY_SAMPLE_PANEL_FEATURE_ID("QtPanelFeature");
25     return MY_SAMPLE_PANEL_FEATURE_ID;
26   }
27
28   /// Total number of objects, initial and translated objects
29   inline static const std::string& VALUE_ID()
30   {
31     static const std::string MY_VALUE_ID("Value");
32     return MY_VALUE_ID;
33   }
34
35   /// Request for initialization of data model of the object: adding all attributes
36   virtual void initAttributes();
37
38   /// Returns the unique kind of a feature
39   virtual const std::string& getKind() {
40     static std::string MY_KIND = SamplePanelPlugin_Feature::ID();
41     return MY_KIND;
42   };
43
44   /// Computes or recomputes the results
45   virtual void execute() {}
46
47   /// Use plugin manager for features creation
48   SamplePanelPlugin_Feature();
49 };
50
51 typedef std::shared_ptr<SamplePanelPlugin_Feature> SamplePanelFeaturePtr;
52
53 #endif