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