Salome HOME
ab85db052adf3c608ff38563409c6fe0be928521
[modules/shaper.git] / src / ModelHighAPI / ModelHighAPI.i
1 // Copyright (C) 2014-2019  CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 /* ModelHighAPI.i */
21 %module(directors="1") ModelHighAPI
22 %feature("director:except") {
23     if ($error != NULL) {
24       PyErr_Print();
25       std::cerr << std::endl;
26       throw Swig::DirectorMethodException();
27     }
28 }
29
30 %{
31   #include "ModelHighAPI_swig.h"
32
33   // fix for SWIG v2.0.4
34   #define SWIGPY_SLICE_ARG(obj) ((PyObject*)(obj))
35 %}
36
37 %include "doxyhelp.i"
38
39 // import other modules
40 %import "GeomAPI.i"
41 %import "ModelAPI.i"
42 %import "GeomDataAPI.i"
43
44 // to avoid error on this
45 #define MODELHIGHAPI_EXPORT
46
47 // standard definitions
48 %include "typemaps.i"
49 %include "std_list.i"
50 %include "std_pair.i"
51 %include "std_string.i"
52 %include "std_shared_ptr.i"
53
54 // directors
55 %feature("director") ModelHighAPI_Dumper;
56
57 // shared pointers
58 %shared_ptr(ModelHighAPI_Interface)
59 %shared_ptr(ModelHighAPI_Folder)
60
61 // typemaps
62
63 %typemap(in) const ModelHighAPI_Double & (ModelHighAPI_Double temp) {
64   if (PyFloat_Check($input) || PyLong_Check($input)) {
65     temp = ModelHighAPI_Double(PyFloat_AsDouble($input));
66     $1 = &temp;
67   } else if (PyUnicode_Check($input)) {
68     temp = ModelHighAPI_Double(PyUnicode_AsUTF8($input));
69     $1 = &temp;
70   } else if ((SWIG_ConvertPtr($input, (void **)&$1, $1_descriptor, SWIG_POINTER_EXCEPTION)) == 0) {
71   } else {
72     PyErr_SetString(PyExc_ValueError, "argument must be ModelHighAPI_Double, float, int or string.");
73     return NULL;
74   }
75 }
76 %typecheck(SWIG_TYPECHECK_POINTER) ModelHighAPI_Double, const ModelHighAPI_Double & {
77   $1 = ((PyFloat_Check($input) || PyLong_Check($input) || PyUnicode_Check($input)) && !PyBool_Check($input)) ? 1 : 0;
78 }
79
80 %typemap(in) const ModelHighAPI_Integer & (ModelHighAPI_Integer temp) {
81   if (PyLong_Check($input)) {
82     temp = ModelHighAPI_Integer(static_cast<int>(PyLong_AsLong($input)));
83     $1 = &temp;
84   } else if (PyUnicode_Check($input)) {
85     temp = ModelHighAPI_Integer(PyUnicode_AsUTF8($input));
86     $1 = &temp;
87   } else if ((SWIG_ConvertPtr($input, (void **)&$1, $1_descriptor, SWIG_POINTER_EXCEPTION)) == 0) {
88   } else {
89     PyErr_SetString(PyExc_ValueError, "argument must be ModelHighAPI_Integer, int or string.");
90     return NULL;
91   }
92 }
93 %typecheck(SWIG_TYPECHECK_POINTER) ModelHighAPI_Integer, const ModelHighAPI_Integer & {
94   $1 = ((PyLong_Check($input) || PyUnicode_Check($input)) && !PyBool_Check($input)) ? 1 : 0;
95 }
96
97 %typemap(in) const ModelHighAPI_RefAttr & (ModelHighAPI_RefAttr temp) {
98   std::shared_ptr<ModelAPI_Attribute> * temp_attribute;
99   std::shared_ptr<ModelAPI_Object> * temp_object;
100   std::shared_ptr<ModelHighAPI_Interface> * temp_interface;
101   ModelHighAPI_Selection* temp_selection;
102   int newmem = 0;
103   if ((SWIG_ConvertPtrAndOwn($input, (void **)&temp_selection, $descriptor(ModelHighAPI_Selection*), SWIG_POINTER_EXCEPTION, &newmem)) == 0) {
104     if (!temp_selection) {
105       PyErr_SetString(PyExc_TypeError, "argument must be ModelHighAPI_RefAttr, ModelHighAPI_Selection, ModelHighAPI_Interface, ModelAPI_Attribute or ModelAPI_Object.");
106       return NULL;
107     }
108     temp = ModelHighAPI_RefAttr(std::shared_ptr<ModelAPI_Object>(temp_selection->resultSubShapePair().first));
109     if (newmem & SWIG_CAST_NEW_MEMORY) {
110       delete temp_selection;
111     }
112     $1 = &temp;
113   } else
114   if ((SWIG_ConvertPtrAndOwn($input, (void **)&temp_attribute, $descriptor(std::shared_ptr<ModelAPI_Attribute> *), SWIG_POINTER_EXCEPTION, &newmem)) == 0) {
115     if (!temp_attribute) {
116       PyErr_SetString(PyExc_TypeError, "argument must be ModelHighAPI_RefAttr, ModelHighAPI_Selection, ModelHighAPI_Interface, ModelAPI_Attribute or ModelAPI_Object.");
117       return NULL;
118     }
119     temp = ModelHighAPI_RefAttr(*temp_attribute);
120     if (newmem & SWIG_CAST_NEW_MEMORY) {
121       delete temp_attribute;
122     }
123     $1 = &temp;
124   } else
125   if ((SWIG_ConvertPtrAndOwn($input, (void **)&temp_object, $descriptor(std::shared_ptr<ModelAPI_Object> *), SWIG_POINTER_EXCEPTION, &newmem)) == 0) {
126     if (!temp_object) {
127       PyErr_SetString(PyExc_TypeError, "argument must be ModelHighAPI_RefAttr, ModelHighAPI_Selection, ModelHighAPI_Interface, ModelAPI_Attribute or ModelAPI_Object.");
128       return NULL;
129     }
130     temp = ModelHighAPI_RefAttr(*temp_object);
131     if (newmem & SWIG_CAST_NEW_MEMORY) {
132       delete temp_object;
133     }
134     $1 = &temp;
135   } else
136   if ((SWIG_ConvertPtrAndOwn($input, (void **)&temp_interface, $descriptor(std::shared_ptr<ModelHighAPI_Interface> *), SWIG_POINTER_EXCEPTION, &newmem)) == 0) {
137     if (!temp_interface) {
138       PyErr_SetString(PyExc_TypeError, "argument must be ModelHighAPI_RefAttr, ModelHighAPI_Selection, ModelHighAPI_Interface, ModelAPI_Attribute or ModelAPI_Object.");
139       return NULL;
140     }
141     temp = ModelHighAPI_RefAttr(*temp_interface);
142     if (newmem & SWIG_CAST_NEW_MEMORY) {
143       delete temp_interface;
144     }
145     $1 = &temp;
146   } else
147   if ((SWIG_ConvertPtr($input, (void **)&$1, $1_descriptor, SWIG_POINTER_EXCEPTION)) == 0) {
148   } else {
149     PyErr_SetString(PyExc_TypeError, "argument must be ModelHighAPI_RefAttr, ModelHighAPI_Selection, ModelHighAPI_Interface, ModelAPI_Attribute or ModelAPI_Object.");
150     return NULL;
151   }
152 }
153
154 %typecheck(SWIG_TYPECHECK_POINTER) ModelHighAPI_RefAttr, const ModelHighAPI_RefAttr & {
155   std::shared_ptr<ModelAPI_Attribute> * temp_attribute;
156   std::shared_ptr<ModelAPI_Object> * temp_object;
157   std::shared_ptr<ModelHighAPI_Interface> * temp_interface;
158   ModelHighAPI_Selection* temp_selection;
159   int newmem = 0;
160   if ((SWIG_ConvertPtrAndOwn($input, (void **)&temp_attribute, $descriptor(std::shared_ptr<ModelAPI_Attribute> *), SWIG_POINTER_EXCEPTION, &newmem)) == 0) {
161     if (temp_attribute) {
162       $1 = 1;
163     } else {
164       $1 = 0;
165     }
166   } else if ((SWIG_ConvertPtrAndOwn($input, (void **)&temp_object, $descriptor(std::shared_ptr<ModelAPI_Object> *), SWIG_POINTER_EXCEPTION, &newmem)) == 0) {
167     if (temp_object) {
168       $1 = 1;
169     } else {
170       $1 = 0;
171     }
172   } else if ((SWIG_ConvertPtrAndOwn($input, (void **)&temp_interface, $descriptor(std::shared_ptr<ModelHighAPI_Interface> *), SWIG_POINTER_EXCEPTION, &newmem)) == 0) {
173     if (temp_interface) {
174       $1 = 1;
175     } else {
176       $1 = 0;
177     }
178   } else if ((SWIG_ConvertPtrAndOwn($input, (void **)&temp_selection, $descriptor(ModelHighAPI_Selection*), SWIG_POINTER_EXCEPTION, &newmem)) == 0) {
179     if (temp_selection) {
180       $1 = 1;
181     } else {
182       $1 = 0;
183     }
184   } else {
185     $1 = 0;
186   }
187 }
188
189 %typemap(in) const ModelHighAPI_Reference & (ModelHighAPI_Reference temp) {
190   std::shared_ptr<ModelAPI_Object> * temp_object;
191   std::shared_ptr<ModelHighAPI_Interface> * temp_interface;
192   int newmem = 0;
193   if ((SWIG_ConvertPtrAndOwn($input, (void **)&temp_object, $descriptor(std::shared_ptr<ModelAPI_Object> *), SWIG_POINTER_EXCEPTION, &newmem)) == 0) {
194     if (!temp_object) {
195       PyErr_SetString(PyExc_TypeError, "argument must be ModelHighAPI_Interface or ModelAPI_Object.");
196       return NULL;
197     }
198     temp = ModelHighAPI_Reference(*temp_object);
199     if (newmem & SWIG_CAST_NEW_MEMORY) {
200       delete temp_object;
201     }
202     $1 = &temp;
203   } else
204   if ((SWIG_ConvertPtrAndOwn($input, (void **)&temp_interface, $descriptor(std::shared_ptr<ModelHighAPI_Interface> *), SWIG_POINTER_EXCEPTION, &newmem)) == 0) {
205     if (!temp_interface) {
206       PyErr_SetString(PyExc_TypeError, "argument must be ModelHighAPI_Interface or ModelAPI_Object.");
207       return NULL;
208     }
209     temp = ModelHighAPI_Reference(*temp_interface);
210     if (newmem & SWIG_CAST_NEW_MEMORY) {
211       delete temp_interface;
212     }
213     $1 = &temp;
214   } else
215   if ((SWIG_ConvertPtr($input, (void **)&$1, $1_descriptor, SWIG_POINTER_EXCEPTION)) == 0) {
216   } else {
217     PyErr_SetString(PyExc_TypeError, "argument must be ModelHighAPI_Interface or ModelAPI_Object.");
218     return NULL;
219   }
220 }
221
222 %typecheck(SWIG_TYPECHECK_POINTER) ModelHighAPI_Reference, const ModelHighAPI_Reference & {
223   std::shared_ptr<ModelAPI_Object> * temp_object;
224   std::shared_ptr<ModelHighAPI_Interface> * temp_interface;
225   int newmem = 0;
226   if ((SWIG_ConvertPtrAndOwn($input, (void **)&temp_object, $descriptor(std::shared_ptr<ModelAPI_Object> *), SWIG_POINTER_EXCEPTION, &newmem)) == 0) {
227     if (temp_object) {
228       $1 = 1;
229     } else {
230       $1 = 0;
231     }
232   } else
233   if ((SWIG_ConvertPtrAndOwn($input, (void **)&temp_interface, $descriptor(std::shared_ptr<ModelHighAPI_Interface> *), SWIG_POINTER_EXCEPTION, &newmem)) == 0) {
234     if (temp_interface) {
235       $1 = 1;
236     } else {
237       $1 = 0;
238     }
239   } else {
240     $1 = 0;
241   }
242 }
243
244 %typemap(out) const ModelHighAPI_Selection & {
245   $1_basetype * ptr = new $1_basetype(*$1);
246   $result = SWIG_NewPointerObj( (void*) ptr, $1_descriptor, 1 );
247 }
248
249 %typemap(out) const ModelHighAPI_Reference & {
250   $1_basetype * ptr = new $1_basetype(*$1);
251   $result = SWIG_NewPointerObj( (void*) ptr, $1_descriptor, 1 );
252 }
253
254 %typemap(out) const ModelHighAPI_RefAttr & {
255   $1_basetype * ptr = new $1_basetype(*$1);
256   $result = SWIG_NewPointerObj( (void*) ptr, $1_descriptor, 1 );
257 }
258
259 // std::list -> []
260 %template(SelectionList) std::list<ModelHighAPI_Selection>;
261 %template(SelectionListList) std::list<std::list<ModelHighAPI_Selection> >;
262 %template(RefAttrList) std::list<ModelHighAPI_RefAttr>;
263 %template(RefList) std::list<ModelHighAPI_Reference>;
264 %template(DoubleList) std::list<ModelHighAPI_Double>;
265 %template(IntegerList) std::list<ModelHighAPI_Integer>;
266
267 // std::pair -> []
268 %template(ResultSubShapePair) std::pair<std::shared_ptr<ModelAPI_Result>, std::shared_ptr<GeomAPI_Shape> >;
269 %template(StringsPair) std::pair<std::string, std::string>;
270
271
272 // fix compilarion error: 'res*' was not declared in this scope
273 %typemap(freearg) const std::list<ModelHighAPI_RefAttr> & {}
274 %typemap(freearg) const std::list<std::shared_ptr<ModelAPI_Object> > & {}
275
276 %typemap(in) const std::list<ModelHighAPI_RefAttr> & (std::list<ModelHighAPI_RefAttr> temp) {
277   std::shared_ptr<ModelAPI_Attribute> * temp_attribute;
278   int newmem = 0;
279   if (PySequence_Check($input)) {
280     for (Py_ssize_t i = 0; i < PySequence_Size($input); ++i) {
281       PyObject * item = PySequence_GetItem($input, i);
282       if ((SWIG_ConvertPtrAndOwn(item, (void **)&temp_attribute, $descriptor(std::shared_ptr<ModelAPI_Attribute> *), SWIG_POINTER_EXCEPTION, &newmem)) == 0) {
283         if (!temp_attribute) {
284           PyErr_SetString(PyExc_TypeError, "argument must be list of ModelHighAPI_RefAttr, ModelHighAPI_Interface, ModelAPI_Attribute or ModelAPI_Object.");
285           return NULL;
286         }
287         temp.push_back(ModelHighAPI_RefAttr(*temp_attribute));
288         if (newmem & SWIG_CAST_NEW_MEMORY) {
289           delete temp_attribute;
290         }
291       }
292       Py_DECREF(item);
293     }
294     $1 = &temp;
295   } else {
296     PyErr_SetString(PyExc_ValueError, "argument must be list of ModelHighAPI_RefAttr, ModelHighAPI_Interface, ModelAPI_Attribute or ModelAPI_Object.");
297     return NULL;
298   }
299 }
300
301 %typemap(in) const std::list<std::shared_ptr<ModelAPI_Object> > & (std::list<std::shared_ptr<ModelAPI_Object> > temp) {
302   std::shared_ptr<ModelAPI_Object> * temp_object;
303   std::shared_ptr<ModelHighAPI_Interface> * temp_interface;
304   int newmem = 0;
305   if (PySequence_Check($input)) {
306     for (Py_ssize_t i = 0; i < PySequence_Size($input); ++i) {
307       PyObject * item = PySequence_GetItem($input, i);
308       if ((SWIG_ConvertPtrAndOwn(item, (void **)&temp_object, $descriptor(std::shared_ptr<ModelAPI_Object> *), SWIG_POINTER_EXCEPTION, &newmem)) == 0) {
309         if (!temp_object) {
310           PyErr_SetString(PyExc_TypeError, "argument must be list of ModelHighAPI_Interface or ModelAPI_Object.");
311           return NULL;
312         }
313         temp.push_back(*temp_object);
314         if (newmem & SWIG_CAST_NEW_MEMORY) {
315           delete temp_object;
316         }
317       } else
318       if ((SWIG_ConvertPtrAndOwn(item, (void **)&temp_interface, $descriptor(std::shared_ptr<ModelHighAPI_Interface> *), SWIG_POINTER_EXCEPTION, &newmem)) == 0) {
319         if (!temp_interface) {
320           PyErr_SetString(PyExc_TypeError, "argument must be list of ModelHighAPI_Interface or ModelAPI_Object.");
321           return NULL;
322         }
323         temp.push_back((*temp_interface)->defaultResult());
324         if (newmem & SWIG_CAST_NEW_MEMORY) {
325           delete temp_interface;
326         }
327       }
328       Py_DECREF(item);
329     }
330     $1 = &temp;
331   } else {
332     PyErr_SetString(PyExc_ValueError, "argument must be list of ModelHighAPI_Interface or ModelAPI_Object.");
333     return NULL;
334   }
335 }
336
337 %typecheck(SWIG_TYPECHECK_POINTER) std::list<std::shared_ptr<ModelAPI_Object> >, const std::list<std::shared_ptr<ModelAPI_Object> >& {
338   std::shared_ptr<ModelAPI_Object> * temp_object;
339   std::shared_ptr<ModelHighAPI_Interface> * temp_interface;
340   int newmem = 0;
341   if (PySequence_Check($input)) {
342     for (Py_ssize_t i = 0; i < PySequence_Size($input); ++i) {
343       PyObject * item = PySequence_GetItem($input, i);
344       if ((SWIG_ConvertPtrAndOwn(item, (void **)&temp_object, $descriptor(std::shared_ptr<ModelAPI_Object> *), SWIG_POINTER_EXCEPTION, &newmem)) == 0) {
345         if (temp_object) {
346           $1 = 1;
347         } else {
348           $1 = 0;
349           break;
350         }
351       } else
352       if ((SWIG_ConvertPtrAndOwn(item, (void **)&temp_interface, $descriptor(std::shared_ptr<ModelHighAPI_Interface> *), SWIG_POINTER_EXCEPTION, &newmem)) == 0) {
353         if (temp_interface) {
354           $1 = 1;
355         } else {
356           $1 = 0;
357           break;
358         }
359       }
360       Py_DECREF(item);
361     }
362   } else {
363     $1 = 0;
364   }
365 }
366
367
368 %typemap(in) const std::list<int> & (std::list<int> temp) {
369   int newmem = 0;
370   if (PySequence_Check($input)) {
371     for (Py_ssize_t i = 0; i < PySequence_Size($input); ++i) {
372       PyObject * item = PySequence_GetItem($input, i);
373       if (PyLong_Check(item)) {
374         temp.push_back((int)PyLong_AsLong(item));
375       } else {
376         PyErr_SetString(PyExc_TypeError, "argument must integet value.");
377         return NULL;
378       }
379       Py_DECREF(item);
380     }
381     $1 = &temp;
382   } else {
383     PyErr_SetString(PyExc_ValueError, "argument must be a tuple of integer values.");
384     return NULL;
385   }
386 }
387
388 %typecheck(SWIG_TYPECHECK_POINTER) std::list<int>, const std::list<int>& {
389   int newmem = 0;
390   if (PySequence_Check($input)) {
391     for (Py_ssize_t i = 0; i < PySequence_Size($input); ++i) {
392       PyObject * item = PySequence_GetItem($input, i);
393       if (PyLong_Check(item)) {
394         $1 = 1;
395       } else {
396         $1 = 0;
397         break;
398       }
399       Py_DECREF(item);
400     }
401   } else {
402     $1 = 0;
403   }
404 }
405
406
407 %typemap(in) const std::list<double> & (std::list<double> temp) {
408   int newmem = 0;
409   if (PyTuple_Check($input)) {
410     for (Py_ssize_t i = 0; i < PyTuple_Size($input); ++i) {
411       PyObject * item = PySequence_GetItem($input, i);
412       if (PyNumber_Check(item)) {
413         temp.push_back((double)PyFloat_AsDouble(item));
414       } else {
415         PyErr_SetString(PyExc_TypeError, "argument must double value.");
416         return NULL;
417       }
418       Py_DECREF(item);
419     }
420     $1 = &temp;
421   } else {
422     PyErr_SetString(PyExc_ValueError, "argument must be a tuple of double values.");
423     return NULL;
424   }
425 }
426
427 %typecheck(SWIG_TYPECHECK_POINTER) std::list<double>, const std::list<double>& {
428   int newmem = 0;
429   if (PyTuple_Check($input)) {
430     for (Py_ssize_t i = 0; i < PyTuple_Size($input); ++i) {
431       PyObject * item = PySequence_GetItem($input, i);
432       if (PyNumber_Check(item)) {
433         $1 = 1;
434       } else {
435         $1 = 0;
436         break;
437       }
438       Py_DECREF(item);
439     }
440   } else {
441     $1 = 0;
442   }
443 }
444
445
446 %typemap(in) const std::list<ModelHighAPI_Double> & (std::list<ModelHighAPI_Double> temp) {
447   ModelHighAPI_Double * temp_double;
448   if (PySequence_Check($input)) {
449     for (Py_ssize_t i = 0; i < PySequence_Size($input); ++i) {
450       PyObject * item = PySequence_GetItem($input, i);
451       if (PyFloat_Check(item) || PyLong_Check(item)) {
452         temp.push_back(ModelHighAPI_Double(PyFloat_AsDouble(item)));
453       } else if (PyUnicode_Check(item)) {
454         temp.push_back(ModelHighAPI_Double(PyUnicode_AsUTF8(item)));
455       } else if ((SWIG_ConvertPtr(item, (void **)&temp_double, $1_descriptor, SWIG_POINTER_EXCEPTION)) == 0) {
456         temp.push_back(*temp_double);
457       } else {
458         PyErr_SetString(PyExc_ValueError, "argument must be a list of ModelHighAPI_Double, float, int or string.");
459         return NULL;
460       }
461       Py_DECREF(item);
462     }
463     $1 = &temp;
464   } else {
465     PyErr_SetString(PyExc_ValueError, "argument must be a list of ModelHighAPI_Double, float, int or string.");
466     return NULL;
467   }
468 }
469
470 %typecheck(SWIG_TYPECHECK_POINTER) std::list<ModelHighAPI_Double>, const std::list<ModelHighAPI_Double> & {
471   if (PySequence_Check($input)) {
472     $1 = 1;
473     for (Py_ssize_t i = 0; i < PySequence_Size($input) && $1; ++i) {
474       PyObject * item = PySequence_GetItem($input, i);
475       $1 = ((PyFloat_Check(item) || PyLong_Check(item) || PyUnicode_Check(item)) && !PyBool_Check(item)) ? 1 : 0;
476       Py_DECREF(item);
477     }
478   } else {
479     $1 = 0;
480   }
481 }
482
483
484 %typemap(in) const std::list<ModelHighAPI_Integer> & (std::list<ModelHighAPI_Integer> temp) {
485   ModelHighAPI_Integer * temp_int;
486   if (PySequence_Check($input)) {
487     for (Py_ssize_t i = 0; i < PySequence_Size($input); ++i) {
488       PyObject * item = PySequence_GetItem($input, i);
489       if (PyLong_Check(item)) {
490         temp.push_back(ModelHighAPI_Integer(PyLong_AsLong(item)));
491       } else if (PyUnicode_Check(item)) {
492         temp.push_back(ModelHighAPI_Integer(PyUnicode_AsUTF8(item)));
493       } else if ((SWIG_ConvertPtr(item, (void **)&temp_int, $1_descriptor, SWIG_POINTER_EXCEPTION)) == 0) {
494         temp.push_back(*temp_int);
495       } else {
496         PyErr_SetString(PyExc_ValueError, "argument must be a list of ModelHighAPI_Integer, int or string.");
497         return NULL;
498       }
499       Py_DECREF(item);
500     }
501     $1 = &temp;
502   } else {
503     PyErr_SetString(PyExc_ValueError, "argument must be a list of ModelHighAPI_Integer, int or string.");
504     return NULL;
505   }
506 }
507
508 %typecheck(SWIG_TYPECHECK_POINTER) std::list<ModelHighAPI_Integer>, const std::list<ModelHighAPI_Integer> & {
509   if (PySequence_Check($input)) {
510     $1 = 1;
511     for (Py_ssize_t i = 0; i < PySequence_Size($input) && $1; ++i) {
512       PyObject * item = PySequence_GetItem($input, i);
513       $1 = ((PyLong_Check(item) || PyUnicode_Check(item)) && !PyBool_Check(item)) ? 1 : 0;
514       Py_DECREF(item);
515     }
516   } else {
517     $1 = 0;
518   }
519 }
520
521
522 // all supported interfaces
523 %include "ModelHighAPI_Double.h"
524 %include "ModelHighAPI_Dumper.h"
525 %include "ModelHighAPI_Integer.h"
526 %include "ModelHighAPI_Interface.h"
527 %include "ModelHighAPI_Folder.h"
528 %include "ModelHighAPI_RefAttr.h"
529 %include "ModelHighAPI_Reference.h"
530 %include "ModelHighAPI_Selection.h"
531 %include "ModelHighAPI_Services.h"
532 %include "ModelHighAPI_Macro.h"
533 %include "ModelHighAPI_Tools.h"