Salome HOME
Porting to SALOME 9.1.0.
[modules/shaper.git] / src / ModelHighAPI / ModelHighAPI.i
index 0b49cf05c46f9696caef19d8b3a333fd61b969ad..2d4b6a8c86f76a7606de2653f564ce24f995436d 100644 (file)
@@ -32,7 +32,7 @@
   #include "ModelHighAPI_swig.h"
 
   // fix for SWIG v2.0.4
-  #define SWIGPY_SLICE_ARG(obj) ((PySliceObject*)(obj))
+  #define SWIGPY_SLICE_ARG(obj) ((PyObject*)(obj))
 %}
 
 %include "doxyhelp.i"
 // typemaps
 
 %typemap(in) const ModelHighAPI_Double & (ModelHighAPI_Double temp) {
-  if (PyFloat_Check($input) || PyInt_Check($input) || PyLong_Check($input)) {
+  if (PyFloat_Check($input) || PyLong_Check($input)) {
     temp = ModelHighAPI_Double(PyFloat_AsDouble($input));
     $1 = &temp;
-  } else if (PyString_Check($input)) {
-    temp = ModelHighAPI_Double(PyString_AsString($input));
+  } else if (PyUnicode_Check($input)) {
+    temp = ModelHighAPI_Double(PyUnicode_AsUTF8($input));
     $1 = &temp;
   } else if ((SWIG_ConvertPtr($input, (void **)&$1, $1_descriptor, SWIG_POINTER_EXCEPTION)) == 0) {
   } else {
   }
 }
 %typecheck(SWIG_TYPECHECK_POINTER) ModelHighAPI_Double, const ModelHighAPI_Double & {
-  $1 = ((PyFloat_Check($input) || PyInt_Check($input) || PyLong_Check($input) || PyString_Check($input)) && !PyBool_Check($input)) ? 1 : 0;
+  $1 = ((PyFloat_Check($input) || PyLong_Check($input) || PyUnicode_Check($input)) && !PyBool_Check($input)) ? 1 : 0;
 }
 
 %typemap(in) const ModelHighAPI_Integer & (ModelHighAPI_Integer temp) {
-  if (PyInt_Check($input)) {
-    temp = ModelHighAPI_Integer(static_cast<int>(PyInt_AsLong($input)));
+  if (PyLong_Check($input)) {
+    temp = ModelHighAPI_Integer(static_cast<int>(PyLong_AsLong($input)));
     $1 = &temp;
-  } else if (PyString_Check($input)) {
-    temp = ModelHighAPI_Integer(PyString_AsString($input));
+  } else if (PyUnicode_Check($input)) {
+    temp = ModelHighAPI_Integer(PyUnicode_AsUTF8($input));
     $1 = &temp;
   } else if ((SWIG_ConvertPtr($input, (void **)&$1, $1_descriptor, SWIG_POINTER_EXCEPTION)) == 0) {
   } else {
@@ -92,7 +92,7 @@
   }
 }
 %typecheck(SWIG_TYPECHECK_POINTER) ModelHighAPI_Integer, const ModelHighAPI_Integer & {
-  $1 = ((PyInt_Check($input) || PyString_Check($input)) && !PyBool_Check($input)) ? 1 : 0;
+  $1 = ((PyLong_Check($input) || PyUnicode_Check($input)) && !PyBool_Check($input)) ? 1 : 0;
 }
 
 %typemap(in) const ModelHighAPI_RefAttr & (ModelHighAPI_RefAttr temp) {