Salome HOME
63199a34b4957b1afa32ee4c89dbea6f6b1d186d
[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_list.i"
16 %include "std_string.i"
17 %include "std_shared_ptr.i"
18
19 // shared pointers
20 %shared_ptr(ModelHighAPI_Interface)
21
22 // typemaps
23 %typemap(in) const ModelHighAPI_Double & (ModelHighAPI_Double temp) {
24   if (PyFloat_Check($input) || PyInt_Check($input) || PyLong_Check($input)) {
25     temp = ModelHighAPI_Double(PyFloat_AsDouble($input));
26     $1 = &temp;
27   } else if (PyString_Check($input)) {
28     temp = ModelHighAPI_Double(PyString_AsString($input));
29     $1 = &temp;
30   } else if ((SWIG_ConvertPtr($input, (void **)&$1, $1_descriptor, SWIG_POINTER_EXCEPTION)) == 0) {
31   } else {
32     PyErr_SetString(PyExc_ValueError, "argument must be ModelHighAPI_Double, float, int or string.");
33     return NULL;
34   }
35 }
36
37 %typecheck(SWIG_TYPECHECK_POINTER) ModelHighAPI_Double, const ModelHighAPI_Double & {
38   $1 = (PyFloat_Check($input) || PyInt_Check($input) || PyLong_Check($input) || PyString_Check($input)) ? 1 : 0;
39 }
40
41 // all supported interfaces
42 %include "ModelHighAPI_Double.h"
43 %include "ModelHighAPI_Interface.h"
44 %include "ModelHighAPI_Macro.h"
45 %include "ModelHighAPI_Selection.h"
46 %include "ModelHighAPI_Tools.h"
47
48 // std::list -> []
49 %template(SelectionList) std::list<ModelHighAPI_Selection>;