X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FFeaturesAPI%2FFeaturesAPI.i;h=c2fc5179589d2cc28f7f645f9ad0b9769c54019b;hb=7ae186c144dfecba2dedeaeba2b6691cef9408f8;hp=01ca8e21a9c7eb0048841e71ed6ab076bee7c92f;hpb=72b184a5bc6d0e99a77ced169a62ddfba86d5043;p=modules%2Fshaper.git diff --git a/src/FeaturesAPI/FeaturesAPI.i b/src/FeaturesAPI/FeaturesAPI.i index 01ca8e21a..c2fc51795 100644 --- a/src/FeaturesAPI/FeaturesAPI.i +++ b/src/FeaturesAPI/FeaturesAPI.i @@ -43,8 +43,10 @@ %feature("kwargs") addFuse; %feature("kwargs") addPartition; %feature("kwargs") addPlacement; +%feature("kwargs") addRotation; %feature("kwargs") addSplit; %feature("kwargs") addSmash; +%feature("kwargs") addTranslation; %feature("kwargs") addUnion; // shared pointers @@ -144,6 +146,48 @@ // fix compilation error: 'res*' was not declared in this scope %typemap(freearg) const std::pair, bool> & {} + +%typecheck(SWIG_TYPECHECK_POINTER) std::pair, const std::pair & { + ModelHighAPI_Selection* temp_selection; + int newmem = 0; + if ((SWIG_ConvertPtrAndOwn($input, (void **)&temp_selection, $descriptor(ModelHighAPI_Selection*), SWIG_POINTER_EXCEPTION, &newmem)) == 0) { + if (temp_selection) { + $1 = 1; + } else { + $1 = 0; + } + } else { + $1 = ((PyFloat_Check($input) || PyLong_Check($input) || PyUnicode_Check($input)) && !PyBool_Check($input)) ? 1 : 0; + } +} + +%typemap(in) const std::pair & (std::pair temp) { + ModelHighAPI_Selection* temp_selection; + int newmem = 0; + if ((SWIG_ConvertPtrAndOwn($input, (void **)&temp_selection, $descriptor(ModelHighAPI_Selection*), SWIG_POINTER_EXCEPTION, &newmem)) == 0) { + if (temp_selection) { + temp = std::pair(*temp_selection, ModelHighAPI_Double(0.0)); + if (newmem & SWIG_CAST_NEW_MEMORY) { + delete temp_selection; + } + } + } else if (PyFloat_Check($input) || PyLong_Check($input)) { + temp = std::pair(ModelHighAPI_Selection(), ModelHighAPI_Double(PyFloat_AsDouble($input))); + } else if (PyUnicode_Check($input)) { + temp = std::pair(ModelHighAPI_Selection(), ModelHighAPI_Double(PyUnicode_AsUTF8($input))); + } else if ((SWIG_ConvertPtr($input, (void **)&$1, $1_descriptor, SWIG_POINTER_EXCEPTION)) == 0) { + temp = std::pair($1->first, $1->second); + } else { + PyErr_SetString(PyExc_ValueError, "argument must be selection, ModelHighAPI_Double, float, int or string."); + return NULL; + } + $1 = &temp; +} + +// fix compilation error: 'res*' was not declared in this scope +%typemap(freearg) const std::pair & {} + + // all supported interfaces %include "FeaturesAPI_BooleanCut.h" %include "FeaturesAPI_BooleanFuse.h"