From: spo Date: Fri, 17 Jun 2016 11:48:00 +0000 (+0300) Subject: Fix ParametersAPI X-Git-Tag: V_2.4.0~91^2~7 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=50998af82bc6d9e252b9ccb14005d17a4a3d00f4;p=modules%2Fshaper.git Fix ParametersAPI --- diff --git a/src/ModelHighAPI/ModelHighAPI.i b/src/ModelHighAPI/ModelHighAPI.i index 1a043be26..7ebba1a57 100644 --- a/src/ModelHighAPI/ModelHighAPI.i +++ b/src/ModelHighAPI/ModelHighAPI.i @@ -113,6 +113,10 @@ $result = SWIG_NewPointerObj( (void*) ptr, $1_descriptor, 1 ); } +// std::list -> [] +%template(SelectionList) std::list; +%template(RefAttrList) std::list; + // all supported interfaces %include "ModelHighAPI_Double.h" %include "ModelHighAPI_Integer.h" @@ -121,6 +125,3 @@ %include "ModelHighAPI_Selection.h" %include "ModelHighAPI_Macro.h" %include "ModelHighAPI_Tools.h" - -%template(SelectionList) std::list; -%template(RefAttrList) std::list; diff --git a/src/ParametersAPI/ParametersAPI_Parameter.cpp b/src/ParametersAPI/ParametersAPI_Parameter.cpp index 8ea872d37..fc89a2392 100644 --- a/src/ParametersAPI/ParametersAPI_Parameter.cpp +++ b/src/ParametersAPI/ParametersAPI_Parameter.cpp @@ -19,12 +19,14 @@ ParametersAPI_Parameter::ParametersAPI_Parameter( ParametersAPI_Parameter::ParametersAPI_Parameter( const std::shared_ptr & theFeature, const std::string & theName, - const ModelHighAPI_Double & theExpression) + const std::string & theExpression, + const std::string & theComment) : ModelHighAPI_Interface(theFeature) { if (initialize()) { fillAttribute(theName, name()); fillAttribute(theExpression, expression()); + fillAttribute(theComment, comment()); execute(); } @@ -37,9 +39,10 @@ ParametersAPI_Parameter::~ParametersAPI_Parameter() //-------------------------------------------------------------------------------------- ParameterPtr addParameter(const std::shared_ptr & theParameter, const std::string & theName, - const ModelHighAPI_Double & theExpression) + const std::string & theExpression, + const std::string & theComment) { // TODO(spo): check that theParameter is not empty std::shared_ptr aFeature = theParameter->addFeature(ParametersAPI_Parameter::ID()); - return ParameterPtr(new ParametersAPI_Parameter(aFeature)); + return ParameterPtr(new ParametersAPI_Parameter(aFeature, theName, theExpression, theComment)); } diff --git a/src/ParametersAPI/ParametersAPI_Parameter.h b/src/ParametersAPI/ParametersAPI_Parameter.h index 5a3023d9b..f3e92af18 100644 --- a/src/ParametersAPI/ParametersAPI_Parameter.h +++ b/src/ParametersAPI/ParametersAPI_Parameter.h @@ -31,14 +31,16 @@ public: PARAMETERSAPI_EXPORT explicit ParametersAPI_Parameter(const std::shared_ptr & theFeature, const std::string & theName, - const ModelHighAPI_Double & theExpression); + const std::string & theExpression, + const std::string & theComment = std::string()); /// Destructor PARAMETERSAPI_EXPORT virtual ~ParametersAPI_Parameter(); - INTERFACE_2(ParametersPlugin_Parameter::ID(), + INTERFACE_3(ParametersPlugin_Parameter::ID(), name, ParametersPlugin_Parameter::VARIABLE_ID(), ModelAPI_AttributeString, /** Name */, - expression, ParametersPlugin_Parameter::EXPRESSION_ID(), ModelAPI_AttributeDouble, /** Expression */ + expression, ParametersPlugin_Parameter::EXPRESSION_ID(), ModelAPI_AttributeString, /** Expression */, + comment, ParametersPlugin_Parameter::COMMENT_ID(), ModelAPI_AttributeString, /** Comment */ ) }; @@ -52,7 +54,8 @@ typedef std::shared_ptr ParameterPtr; PARAMETERSAPI_EXPORT ParameterPtr addParameter(const std::shared_ptr & thePart, const std::string & theName, - const ModelHighAPI_Double & theExpression); + const std::string & theExpression, + const std::string & theComment = std::string()); //-------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------