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