5 #include "ModelHighAPI_swig.h"
8 #define SWIGPY_SLICE_ARG(obj) ((PySliceObject*)(obj))
13 // import other modules
15 %import "GeomDataAPI.i"
17 // to avoid error on this
18 #define MODELHIGHAPI_EXPORT
20 // standard definitions
23 %include "std_string.i"
24 %include "std_shared_ptr.i"
27 %shared_ptr(ModelHighAPI_Interface)
31 %typemap(in) const ModelHighAPI_Double & (ModelHighAPI_Double temp) {
32 if (PyFloat_Check($input) || PyInt_Check($input) || PyLong_Check($input)) {
33 temp = ModelHighAPI_Double(PyFloat_AsDouble($input));
35 } else if (PyString_Check($input)) {
36 temp = ModelHighAPI_Double(PyString_AsString($input));
38 } else if ((SWIG_ConvertPtr($input, (void **)&$1, $1_descriptor, SWIG_POINTER_EXCEPTION)) == 0) {
40 PyErr_SetString(PyExc_ValueError, "argument must be ModelHighAPI_Double, float, int or string.");
44 %typecheck(SWIG_TYPECHECK_POINTER) ModelHighAPI_Double, const ModelHighAPI_Double & {
45 $1 = (PyFloat_Check($input) || PyInt_Check($input) || PyLong_Check($input) || PyString_Check($input)) ? 1 : 0;
48 %typemap(in) const ModelHighAPI_Integer & (ModelHighAPI_Integer temp) {
49 if (PyInt_Check($input)) {
50 temp = ModelHighAPI_Integer(static_cast<int>(PyInt_AsLong($input)));
52 } else if (PyString_Check($input)) {
53 temp = ModelHighAPI_Integer(PyString_AsString($input));
55 } else if ((SWIG_ConvertPtr($input, (void **)&$1, $1_descriptor, SWIG_POINTER_EXCEPTION)) == 0) {
57 PyErr_SetString(PyExc_ValueError, "argument must be ModelHighAPI_Integer, int or string.");
61 %typecheck(SWIG_TYPECHECK_POINTER) ModelHighAPI_Integer, const ModelHighAPI_Integer & {
62 $1 = (PyInt_Check($input) || PyString_Check($input)) ? 1 : 0;
65 %typemap(in) const ModelHighAPI_RefAttr & (ModelHighAPI_RefAttr temp) {
66 std::shared_ptr<ModelAPI_Attribute> * temp_attribute;
67 std::shared_ptr<ModelAPI_Object> * temp_object;
68 std::shared_ptr<ModelHighAPI_Interface> * temp_interface;
70 if ((SWIG_ConvertPtrAndOwn($input, (void **)&temp_attribute, $descriptor(std::shared_ptr<ModelAPI_Attribute> *), SWIG_POINTER_EXCEPTION, &newmem)) == 0) {
71 if (!temp_attribute) {
72 PyErr_SetString(PyExc_TypeError, "argument must be ModelHighAPI_RefAttr, ModelHighAPI_Interface, ModelAPI_Attribute or ModelAPI_Object.");
75 temp = ModelHighAPI_RefAttr(*temp_attribute);
76 if (newmem & SWIG_CAST_NEW_MEMORY) {
77 delete temp_attribute;
81 if ((SWIG_ConvertPtrAndOwn($input, (void **)&temp_object, $descriptor(std::shared_ptr<ModelAPI_Object> *), SWIG_POINTER_EXCEPTION, &newmem)) == 0) {
83 PyErr_SetString(PyExc_TypeError, "argument must be ModelHighAPI_RefAttr, ModelHighAPI_Interface, ModelAPI_Attribute or ModelAPI_Object.");
86 temp = ModelHighAPI_RefAttr(*temp_object);
87 if (newmem & SWIG_CAST_NEW_MEMORY) {
92 if ((SWIG_ConvertPtrAndOwn($input, (void **)&temp_interface, $descriptor(std::shared_ptr<ModelHighAPI_Interface> *), SWIG_POINTER_EXCEPTION, &newmem)) == 0) {
93 if (!temp_interface) {
94 PyErr_SetString(PyExc_TypeError, "argument must be ModelHighAPI_RefAttr, ModelHighAPI_Interface, ModelAPI_Attribute or ModelAPI_Object.");
97 temp = ModelHighAPI_RefAttr(*temp_interface);
98 if (newmem & SWIG_CAST_NEW_MEMORY) {
99 delete temp_interface;
103 if ((SWIG_ConvertPtr($input, (void **)&$1, $1_descriptor, SWIG_POINTER_EXCEPTION)) == 0) {
105 PyErr_SetString(PyExc_ValueError, "argument must be ModelHighAPI_RefAttr, ModelHighAPI_Interface, ModelAPI_Attribute or ModelAPI_Object.");
110 // all supported interfaces
111 %include "ModelHighAPI_Double.h"
112 %include "ModelHighAPI_Integer.h"
113 %include "ModelHighAPI_Interface.h"
114 %include "ModelHighAPI_Macro.h"
115 %include "ModelHighAPI_RefAttr.h"
116 %include "ModelHighAPI_Selection.h"
117 %include "ModelHighAPI_Tools.h"
119 %template(SelectionList) std::list<ModelHighAPI_Selection>;