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 std::string & theExpression,
23 const std::string & theComment)
24 : ModelHighAPI_Interface(theFeature)
27 fillAttribute(theName, name());
28 fillAttribute(theExpression, expression());
29 fillAttribute(theComment, comment());
35 ParametersAPI_Parameter::~ParametersAPI_Parameter()
39 //--------------------------------------------------------------------------------------
40 ParameterPtr addParameter(const std::shared_ptr<ModelAPI_Document> & thePart,
41 const std::string & theName,
42 const std::string & theExpression,
43 const std::string & theComment)
45 // TODO(spo): check that thePart is not empty
46 std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(ParametersAPI_Parameter::ID());
47 return ParameterPtr(new ParametersAPI_Parameter(aFeature, theName, theExpression, theComment));