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