]> SALOME platform Git repositories - modules/shaper.git/blob - src/ModelHighAPI/ModelHighAPI.i
Salome HOME
5c6369cb53c9bff7b658eb887f8c726fd9cb93e8
[modules/shaper.git] / src / ModelHighAPI / ModelHighAPI.i
1 /* ModelHighAPI.i */
2 %module ModelHighAPI
3 %{
4   #include "ModelHighAPI_swig.h"
5 %}
6
7 // to avoid error on this
8 #define ModelHighAPI_EXPORT
9
10 // standard definitions
11 %include "typemaps.i"
12 %include "std_string.i"
13 %include "std_shared_ptr.i"
14
15 // shared pointers
16 %shared_ptr(ModelHighAPI_Interface)
17
18 // typemaps
19 %typemap(in) const ModelHighAPI_Double & (ModelHighAPI_Double temp) {
20   if (PyFloat_Check($input) || PyInt_Check($input) || PyLong_Check($input)) {
21     temp = ModelHighAPI_Double(PyFloat_AsDouble($input));
22     $1 = &temp;
23   } else if (PyString_Check($input)) {
24     temp = ModelHighAPI_Double(PyString_AsString($input));
25     $1 = &temp;
26   } else if ((SWIG_ConvertPtr($input, (void **)&$1, $1_descriptor, SWIG_POINTER_EXCEPTION)) == 0) {
27   } else {
28     PyErr_SetString(PyExc_ValueError, "argument must be ModelHighAPI_Double, float, int or string.");
29     return NULL;
30   }
31 }
32
33 %typecheck(SWIG_TYPECHECK_POINTER) ModelHighAPI_Double, const ModelHighAPI_Double & {
34   $1 = (PyFloat_Check($input) || PyInt_Check($input) || PyLong_Check($input) || PyString_Check($input)) ? 1 : 0;
35 }
36
37 // all supported interfaces
38 %include "ModelHighAPI_Double.h"
39 %include "ModelHighAPI_Interface.h"