1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
2 // Name : ParametersAPI_Parameter.h
6 // 16/06/16 - Sergey POKHODENKO - Creation of the file
8 #ifndef SRC_PARAMETERSAPI_PARAMETERSAPI_PARAMETER_H_
9 #define SRC_PARAMETERSAPI_PARAMETERSAPI_PARAMETER_H_
11 //--------------------------------------------------------------------------------------
12 #include "ParametersAPI.h"
14 #include <ParametersPlugin_Parameter.h>
16 #include <ModelHighAPI_Interface.h>
17 #include <ModelHighAPI_Macro.h>
18 //--------------------------------------------------------------------------------------
19 class ModelHighAPI_Double;
20 //--------------------------------------------------------------------------------------
21 /**\class ParametersAPI_Parameter
23 * \brief Interface for Parameter feature
25 class ParametersAPI_Parameter : public ModelHighAPI_Interface
28 /// Constructor without values
30 explicit ParametersAPI_Parameter(const std::shared_ptr<ModelAPI_Feature> & theFeature);
31 /// Constructor with values
33 explicit ParametersAPI_Parameter(const std::shared_ptr<ModelAPI_Feature> & theFeature,
34 const std::string & theName,
35 const std::string & theExpression,
36 const std::string & theComment = std::string());
39 virtual ~ParametersAPI_Parameter();
41 INTERFACE_3(ParametersPlugin_Parameter::ID(),
42 name, ParametersPlugin_Parameter::VARIABLE_ID(),
43 ModelAPI_AttributeString, /** Name */,
44 expression, ParametersPlugin_Parameter::EXPRESSION_ID(),
45 ModelAPI_AttributeString, /** Expression */,
46 comment, ParametersPlugin_Parameter::COMMENT_ID(),
47 ModelAPI_AttributeString, /** Comment */
50 /// Just sets the numeric value to the parameter (it resets the previous expression)
51 PARAMETERSAPI_EXPORT void setValue(const double theValue);
52 /// Returns the current value of the parameter: the expression result.
53 PARAMETERSAPI_EXPORT double value();
55 /// Dump wrapped feature
57 virtual void dump(ModelHighAPI_Dumper& theDumper) const;
61 //! Pointer on Parameter object
62 typedef std::shared_ptr<ParametersAPI_Parameter> ParameterPtr;
64 /**\ingroup CPPHighAPI
65 * \brief Create Parameter feature
68 ParameterPtr addParameter(const std::shared_ptr<ModelAPI_Document> & thePart,
69 const std::string & theName,
70 const std::string & theExpression,
71 const std::string & theComment = std::string());
73 //--------------------------------------------------------------------------------------
74 //--------------------------------------------------------------------------------------
75 #endif /* SRC_PARAMETERSAPI_PARAMETERSAPI_PARAMETER_H_ */