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 /// attribute name of extrusion size
44 inline static const std::string& EXPRESSION_ERROR_ID()
46 static const std::string MY_EXPRESSION_ERROR_ID("ExpressionError");
47 return MY_EXPRESSION_ERROR_ID;
50 /// list of references to the arguments of this expression
51 inline static const std::string& ARGUMENTS_ID()
53 static const std::string MY_ARGUMENTS_ID("arguments");
54 return MY_ARGUMENTS_ID;
57 /// Returns the kind of a feature
58 PARAMETERSPLUGIN_EXPORT virtual const std::string& getKind()
60 static std::string MY_KIND = ParametersPlugin_Parameter::ID();
64 /// Pre-execution is not needed for parameter
65 PARAMETERSPLUGIN_EXPORT virtual bool isPreviewNeeded() const;
67 /// Creates a new part document if needed
68 PARAMETERSPLUGIN_EXPORT virtual void execute();
70 /// Request for initialization of data model of the feature: adding all attributes
71 PARAMETERSPLUGIN_EXPORT virtual void initAttributes();
73 PARAMETERSPLUGIN_EXPORT virtual bool isInHistory(); //false
75 PARAMETERSPLUGIN_EXPORT virtual void attributeChanged(const std::string& theID);
77 /// Use plugin manager for features creation
78 ParametersPlugin_Parameter();
81 double evaluate(const std::string& theExpression, std::string& theError);
83 void updateExpression();
86 std::shared_ptr<ParametersPlugin_PyInterp> myInterp;