Salome HOME
Merge branch 'Dev_1.1.0' of newgeom:newgeom.git into Dev_1.1.0
[modules/shaper.git] / src / ParametersPlugin / ParametersPlugin_Parameter.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
2
3 // File:        ParametersPlugin_Parameter.h
4 // Created:     23 MArch 2015
5 // Author:      sbh
6
7 #ifndef PARAMETERSPLUGIN_PARAMETER_H_
8 #define PARAMETERSPLUGIN_PARAMETER_H_
9
10 #include "ParametersPlugin.h"
11 #include <ModelAPI_Feature.h>
12
13 class ParametersPlugin_PyInterp;
14
15 class ParametersPlugin_Parameter : public ModelAPI_Feature
16 {
17  public:
18   virtual ~ParametersPlugin_Parameter();
19
20   /// Extrusion kind
21   inline static const std::string& ID()
22   {
23     static const std::string MY_EXTRUSION_ID("Parameter");
24     return MY_EXTRUSION_ID;
25   }
26   /// attribute name of references sketch entities list, it should contain a sketch result or
27   /// a pair a sketch result to sketch face
28   inline static const std::string& VARIABLE_ID()
29   {
30     static const std::string MY_VARIABLE_ID("variable");
31     return MY_VARIABLE_ID;
32   }
33
34   /// attribute name of extrusion size
35   inline static const std::string& EXPRESSION_ID()
36   {
37     static const std::string MY_EXPRESSION_ID("expression");
38     return MY_EXPRESSION_ID;
39   }
40
41   /// Returns the kind of a feature
42   PARAMETERSPLUGIN_EXPORT virtual const std::string& getKind()
43   {
44     static std::string MY_KIND = ParametersPlugin_Parameter::ID();
45     return MY_KIND;
46   }
47
48   /// Creates a new part document if needed
49   PARAMETERSPLUGIN_EXPORT virtual void execute();
50
51   /// Request for initialization of data model of the feature: adding all attributes
52   PARAMETERSPLUGIN_EXPORT virtual void initAttributes();
53
54   PARAMETERSPLUGIN_EXPORT virtual bool isInHistory(); //false
55
56   PARAMETERSPLUGIN_EXPORT virtual void attributeChanged(const std::string& theID);
57
58   /// Use plugin manager for features creation
59   ParametersPlugin_Parameter();
60
61  protected:
62   double evaluate(const std::string& theExpression, std::string& theError);
63
64  private:
65   ParametersPlugin_PyInterp* myInterp;
66 };
67
68 #endif