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