Salome HOME
Dump Python in the High Level Parameterized Geometry API (issue #1648)
[modules/shaper.git] / src / ParametersAPI / ParametersAPI_Parameter.h
1 // Name   : ParametersAPI_Parameter.h
2 // Purpose: 
3 //
4 // History:
5 // 16/06/16 - Sergey POKHODENKO - Creation of the file
6
7 #ifndef SRC_PARAMETERSAPI_PARAMETERSAPI_PARAMETER_H_
8 #define SRC_PARAMETERSAPI_PARAMETERSAPI_PARAMETER_H_
9
10 //--------------------------------------------------------------------------------------
11 #include "ParametersAPI.h"
12
13 #include <ParametersPlugin_Parameter.h>
14
15 #include <ModelHighAPI_Interface.h>
16 #include <ModelHighAPI_Macro.h>
17 //--------------------------------------------------------------------------------------
18 class ModelHighAPI_Double;
19 //--------------------------------------------------------------------------------------
20 /**\class ParametersAPI_Parameter
21  * \ingroup CPPHighAPI
22  * \brief Interface for Parameter feature
23  */
24 class ParametersAPI_Parameter : public ModelHighAPI_Interface
25 {
26 public:
27   /// Constructor without values
28   PARAMETERSAPI_EXPORT
29   explicit ParametersAPI_Parameter(const std::shared_ptr<ModelAPI_Feature> & theFeature);
30   /// Constructor with values
31   PARAMETERSAPI_EXPORT
32   explicit ParametersAPI_Parameter(const  std::shared_ptr<ModelAPI_Feature> & theFeature,
33                                    const std::string & theName,
34                                    const std::string & theExpression,
35                                    const std::string & theComment = std::string());
36   /// Destructor
37   PARAMETERSAPI_EXPORT
38   virtual ~ParametersAPI_Parameter();
39
40   INTERFACE_3(ParametersPlugin_Parameter::ID(),
41               name, ParametersPlugin_Parameter::VARIABLE_ID(), ModelAPI_AttributeString, /** Name */,
42               expression, ParametersPlugin_Parameter::EXPRESSION_ID(), ModelAPI_AttributeString, /** Expression */,
43               comment, ParametersPlugin_Parameter::COMMENT_ID(), ModelAPI_AttributeString, /** Comment */
44   )
45
46   /// Dump wrapped feature
47   PARAMETERSAPI_EXPORT
48   virtual void dump(ModelHighAPI_Dumper& theDumper) const;
49
50 };
51
52 //! Pointer on Parameter object
53 typedef std::shared_ptr<ParametersAPI_Parameter> ParameterPtr;
54
55 /**\ingroup CPPHighAPI
56  * \brief Create Parameter feature
57  */
58 PARAMETERSAPI_EXPORT
59 ParameterPtr addParameter(const std::shared_ptr<ModelAPI_Document> & thePart,
60                           const std::string & theName,
61                           const std::string & theExpression,
62                           const std::string & theComment = std::string());
63
64 //--------------------------------------------------------------------------------------
65 //--------------------------------------------------------------------------------------
66 #endif /* SRC_PARAMETERSAPI_PARAMETERSAPI_PARAMETER_H_ */