1 // Name : ParametersAPI_Parameter.cpp
5 // 16/06/16 - Sergey POKHODENKO - Creation of the file
7 //--------------------------------------------------------------------------------------
8 #include "ParametersAPI_Parameter.h"
9 //--------------------------------------------------------------------------------------
10 #include <ModelHighAPI_Tools.h>
11 //--------------------------------------------------------------------------------------
12 ParametersAPI_Parameter::ParametersAPI_Parameter(
13 const std::shared_ptr<ModelAPI_Feature> & theFeature)
14 : ModelHighAPI_Interface(theFeature)
19 ParametersAPI_Parameter::ParametersAPI_Parameter(
20 const std::shared_ptr<ModelAPI_Feature> & theFeature,
21 const std::string & theName,
22 const ModelHighAPI_Double & theExpression)
23 : ModelHighAPI_Interface(theFeature)
26 fillAttribute(theName, name());
27 fillAttribute(theExpression, expression());
33 ParametersAPI_Parameter::~ParametersAPI_Parameter()
37 //--------------------------------------------------------------------------------------
38 ParameterPtr addParameter(const std::shared_ptr<ModelAPI_Document> & theParameter,
39 const std::string & theName,
40 const ModelHighAPI_Double & theExpression)
42 // TODO(spo): check that theParameter is not empty
43 std::shared_ptr<ModelAPI_Feature> aFeature = theParameter->addFeature(ParametersAPI_Parameter::ID());
44 return ParameterPtr(new ParametersAPI_Parameter(aFeature));