From: spo Date: Fri, 30 Oct 2015 07:43:41 +0000 (+0300) Subject: Add ModelAPI_AttributeIntArray to SWIG X-Git-Tag: V_2.1.0~206^2~44 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=a4f6b08c913dc94916557b256572ab91478bd61f;p=modules%2Fshaper.git Add ModelAPI_AttributeIntArray to SWIG --- diff --git a/src/ModelAPI/ModelAPI.i b/src/ModelAPI/ModelAPI.i index 7da97d0c1..8da7ce250 100644 --- a/src/ModelAPI/ModelAPI.i +++ b/src/ModelAPI/ModelAPI.i @@ -22,6 +22,7 @@ #include "ModelAPI_AttributeDocRef.h" #include "ModelAPI_AttributeDouble.h" #include "ModelAPI_AttributeInteger.h" + #include "ModelAPI_AttributeIntArray.h" #include "ModelAPI_AttributeString.h" #include "ModelAPI_AttributeReference.h" #include "ModelAPI_AttributeRefAttr.h" @@ -83,6 +84,7 @@ %shared_ptr(ModelAPI_AttributeDocRef) %shared_ptr(ModelAPI_AttributeDouble) %shared_ptr(ModelAPI_AttributeInteger) +%shared_ptr(ModelAPI_AttributeIntArray) %shared_ptr(ModelAPI_AttributeString) %shared_ptr(ModelAPI_AttributeReference) %shared_ptr(ModelAPI_AttributeRefAttr) @@ -114,6 +116,7 @@ %include "ModelAPI_AttributeDocRef.h" %include "ModelAPI_AttributeDouble.h" %include "ModelAPI_AttributeInteger.h" +%include "ModelAPI_AttributeIntArray.h" %include "ModelAPI_AttributeString.h" %include "ModelAPI_AttributeReference.h" %include "ModelAPI_AttributeRefAttr.h" @@ -156,6 +159,7 @@ template std::shared_ptr shared_ptr_cast(std::shared_ptr %template(modelAPI_AttributeDocRef) shared_ptr_cast; %template(modelAPI_AttributeDouble) shared_ptr_cast; %template(modelAPI_AttributeInteger) shared_ptr_cast; +%template(modelAPI_AttributeIntArray) shared_ptr_cast; %template(modelAPI_AttributeString) shared_ptr_cast; %template(modelAPI_AttributeReference) shared_ptr_cast; %template(modelAPI_AttributeRefAttr) shared_ptr_cast; diff --git a/src/PythonAPI/model/tools.py b/src/PythonAPI/model/tools.py index e9fc59b93..220fdee4f 100644 --- a/src/PythonAPI/model/tools.py +++ b/src/PythonAPI/model/tools.py @@ -78,11 +78,10 @@ def fill_attribute(attribute, value): else: attribute.setValue(value) -# TODO: ModelAPI_AttributeIntArray should be added to SWIG -# elif isinstance(attribute, ModelAPI.ModelAPI_AttributeIntArray): -# attrubute.setSize(len(value)) -# for i in range(len(value)): -# attrubute.setValue(i, value[i]) + elif isinstance(attribute, ModelAPI.ModelAPI_AttributeIntArray): + attrubute.setSize(len(value)) + for i in range(len(value)): + attrubute.setValue(i, value[i]) elif isinstance(attribute, ModelAPI.ModelAPI_AttributeRefAttr): assert(isinstance(value, ModelAPI.ModelAPI_Attribute) or