Salome HOME
Add ModelHighAPI & ConstructionAPI pachages
[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
14 // all supported interfaces
15 %include "ModelHighAPI_Double.h"
16
17 // typemaps
18 %typemap(in) const ModelHighAPI_Double & (ModelHighAPI_Double temp) {
19   if (PyFloat_Check($input) || PyInt_Check($input) || PyLong_Check($input)) {
20     temp = ModelHighAPI_Double(PyFloat_AsDouble($input));
21     $1 = &temp;
22   } else if (PyString_Check($input)) {
23     temp = ModelHighAPI_Double(PyString_AsString($input));
24     $1 = &temp;
25   } else if ((SWIG_ConvertPtr($input, (void **)&$1, $1_descriptor, SWIG_POINTER_EXCEPTION)) == 0) {
26   } else {
27     PyErr_SetString(PyExc_ValueError, "argument must be ModelHighAPI_Double, float, int or string.");
28     return NULL;
29   }
30 }
31
32 %typecheck(SWIG_TYPECHECK_POINTER) ModelHighAPI_Double, const ModelHighAPI_Double & {
33   $1 = (PyFloat_Check($input) || PyInt_Check($input) || PyLong_Check($input) || PyString_Check($input)) ? 1 : 0;
34 }