1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
3 // File: ParametersPlugin_Parameter.h
4 // Created: 23 MArch 2015
7 #ifndef PARAMETERSPLUGIN_PARAMETER_H_
8 #define PARAMETERSPLUGIN_PARAMETER_H_
10 #include "ParametersPlugin.h"
11 #include <ModelAPI_Feature.h>
15 class ParametersPlugin_PyInterp;
17 class ParametersPlugin_Parameter : public ModelAPI_Feature
20 virtual ~ParametersPlugin_Parameter();
23 inline static const std::string& ID()
25 static const std::string MY_PARAMETER_ID("Parameter");
26 return MY_PARAMETER_ID;
28 /// attribute name of references sketch entities list, it should contain a sketch result or
29 /// a pair a sketch result to sketch face
30 inline static const std::string& VARIABLE_ID()
32 static const std::string MY_VARIABLE_ID("variable");
33 return MY_VARIABLE_ID;
36 /// attribute name of extrusion size
37 inline static const std::string& EXPRESSION_ID()
39 static const std::string MY_EXPRESSION_ID("expression");
40 return MY_EXPRESSION_ID;
43 /// list of references to the arguments of this expression
44 inline static const std::string& ARGUMENTS_ID()
46 static const std::string MY_VARIABLE_ID("arguments");
47 return MY_VARIABLE_ID;
50 /// Returns the kind of a feature
51 PARAMETERSPLUGIN_EXPORT virtual const std::string& getKind()
53 static std::string MY_KIND = ParametersPlugin_Parameter::ID();
57 /// Pre-execution is not needed for parameter
58 PARAMETERSPLUGIN_EXPORT virtual bool isPreviewNeeded() const;
60 /// Creates a new part document if needed
61 PARAMETERSPLUGIN_EXPORT virtual void execute();
63 /// Request for initialization of data model of the feature: adding all attributes
64 PARAMETERSPLUGIN_EXPORT virtual void initAttributes();
66 PARAMETERSPLUGIN_EXPORT virtual bool isInHistory(); //false
68 PARAMETERSPLUGIN_EXPORT virtual void attributeChanged(const std::string& theID);
70 /// Use plugin manager for features creation
71 ParametersPlugin_Parameter();
74 double evaluate(const std::string& theExpression, std::string& theError);
77 std::shared_ptr<ParametersPlugin_PyInterp> myInterp;