1 // Copyright (C) 2014-2017 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or
18 // email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
21 #ifndef SRC_PARAMETERSAPI_PARAMETERSAPI_PARAMETER_H_
22 #define SRC_PARAMETERSAPI_PARAMETERSAPI_PARAMETER_H_
24 //--------------------------------------------------------------------------------------
25 #include "ParametersAPI.h"
27 #include <ParametersPlugin_Parameter.h>
29 #include <ModelHighAPI_Interface.h>
30 #include <ModelHighAPI_Macro.h>
31 //--------------------------------------------------------------------------------------
32 class ModelHighAPI_Double;
33 //--------------------------------------------------------------------------------------
34 /**\class ParametersAPI_Parameter
36 * \brief Interface for Parameter feature
38 class ParametersAPI_Parameter : public ModelHighAPI_Interface
41 /// Constructor without values
43 explicit ParametersAPI_Parameter(const std::shared_ptr<ModelAPI_Feature> & theFeature);
44 /// Constructor with values
46 explicit ParametersAPI_Parameter(const std::shared_ptr<ModelAPI_Feature> & theFeature,
47 const std::string & theName,
48 const std::string & theExpression,
49 const std::string & theComment = std::string());
52 virtual ~ParametersAPI_Parameter();
54 INTERFACE_3(ParametersPlugin_Parameter::ID(),
55 name, ParametersPlugin_Parameter::VARIABLE_ID(),
56 ModelAPI_AttributeString, /** Name */,
57 expression, ParametersPlugin_Parameter::EXPRESSION_ID(),
58 ModelAPI_AttributeString, /** Expression */,
59 comment, ParametersPlugin_Parameter::COMMENT_ID(),
60 ModelAPI_AttributeString, /** Comment */
63 /// Just sets the numeric value to the parameter (it resets the previous expression)
64 PARAMETERSAPI_EXPORT void setValue(const double theValue);
65 /// Returns the current value of the parameter: the expression result.
66 PARAMETERSAPI_EXPORT double value();
68 /// Dump wrapped feature
70 virtual void dump(ModelHighAPI_Dumper& theDumper) const;
74 //! Pointer on Parameter object
75 typedef std::shared_ptr<ParametersAPI_Parameter> ParameterPtr;
77 /**\ingroup CPPHighAPI
78 * \brief Create Parameter feature
81 ParameterPtr addParameter(const std::shared_ptr<ModelAPI_Document> & thePart,
82 const std::string & theName,
83 const std::string & theExpression,
84 const std::string & theComment = std::string());
86 //--------------------------------------------------------------------------------------
87 //--------------------------------------------------------------------------------------
88 #endif /* SRC_PARAMETERSAPI_PARAMETERSAPI_PARAMETER_H_ */