5 #include "ModelHighAPI_swig.h"
10 // import other modules
12 %import "GeomDataAPI.i"
14 // to avoid error on this
15 #define MODELHIGHAPI_EXPORT
17 // standard definitions
20 %include "std_string.i"
21 %include "std_shared_ptr.i"
24 %shared_ptr(ModelHighAPI_Interface)
28 %typemap(in) const ModelHighAPI_Double & (ModelHighAPI_Double temp) {
29 if (PyFloat_Check($input) || PyInt_Check($input) || PyLong_Check($input)) {
30 temp = ModelHighAPI_Double(PyFloat_AsDouble($input));
32 } else if (PyString_Check($input)) {
33 temp = ModelHighAPI_Double(PyString_AsString($input));
35 } else if ((SWIG_ConvertPtr($input, (void **)&$1, $1_descriptor, SWIG_POINTER_EXCEPTION)) == 0) {
37 PyErr_SetString(PyExc_ValueError, "argument must be ModelHighAPI_Double, float, int or string.");
41 %typecheck(SWIG_TYPECHECK_POINTER) ModelHighAPI_Double, const ModelHighAPI_Double & {
42 $1 = (PyFloat_Check($input) || PyInt_Check($input) || PyLong_Check($input) || PyString_Check($input)) ? 1 : 0;
45 %typemap(in) const ModelHighAPI_Integer & (ModelHighAPI_Integer temp) {
46 if (PyInt_Check($input)) {
47 temp = ModelHighAPI_Integer(static_cast<int>(PyInt_AsLong($input)));
49 } else if (PyString_Check($input)) {
50 temp = ModelHighAPI_Integer(PyString_AsString($input));
52 } else if ((SWIG_ConvertPtr($input, (void **)&$1, $1_descriptor, SWIG_POINTER_EXCEPTION)) == 0) {
54 PyErr_SetString(PyExc_ValueError, "argument must be ModelHighAPI_Integer, int or string.");
58 %typecheck(SWIG_TYPECHECK_POINTER) ModelHighAPI_Integer, const ModelHighAPI_Integer & {
59 $1 = (PyInt_Check($input) || PyString_Check($input)) ? 1 : 0;
62 %typemap(in) const ModelHighAPI_RefAttr & (ModelHighAPI_RefAttr temp) {
63 std::shared_ptr<ModelAPI_Attribute> * temp_attribute;
64 std::shared_ptr<ModelAPI_Object> * temp_object;
65 std::shared_ptr<ModelHighAPI_Interface> * temp_interface;
67 if ((SWIG_ConvertPtrAndOwn($input, (void **)&temp_attribute, $descriptor(std::shared_ptr<ModelAPI_Attribute> *), SWIG_POINTER_EXCEPTION, &newmem)) == 0) {
68 if (!temp_attribute) {
69 PyErr_SetString(PyExc_TypeError, "argument must be ModelHighAPI_RefAttr, ModelHighAPI_Interface, ModelAPI_Attribute or ModelAPI_Object.");
72 temp = ModelHighAPI_RefAttr(*temp_attribute);
73 if (newmem & SWIG_CAST_NEW_MEMORY) {
74 delete temp_attribute;
78 if ((SWIG_ConvertPtrAndOwn($input, (void **)&temp_object, $descriptor(std::shared_ptr<ModelAPI_Object> *), SWIG_POINTER_EXCEPTION, &newmem)) == 0) {
80 PyErr_SetString(PyExc_TypeError, "argument must be ModelHighAPI_RefAttr, ModelHighAPI_Interface, ModelAPI_Attribute or ModelAPI_Object.");
83 temp = ModelHighAPI_RefAttr(*temp_object);
84 if (newmem & SWIG_CAST_NEW_MEMORY) {
89 if ((SWIG_ConvertPtrAndOwn($input, (void **)&temp_interface, $descriptor(std::shared_ptr<ModelHighAPI_Interface> *), SWIG_POINTER_EXCEPTION, &newmem)) == 0) {
90 if (!temp_interface) {
91 PyErr_SetString(PyExc_TypeError, "argument must be ModelHighAPI_RefAttr, ModelHighAPI_Interface, ModelAPI_Attribute or ModelAPI_Object.");
94 temp = ModelHighAPI_RefAttr(*temp_interface);
95 if (newmem & SWIG_CAST_NEW_MEMORY) {
96 delete temp_interface;
100 if ((SWIG_ConvertPtr($input, (void **)&$1, $1_descriptor, SWIG_POINTER_EXCEPTION)) == 0) {
102 PyErr_SetString(PyExc_ValueError, "argument must be ModelHighAPI_RefAttr, ModelHighAPI_Interface, ModelAPI_Attribute or ModelAPI_Object.");
107 // all supported interfaces
108 %include "ModelHighAPI_Double.h"
109 %include "ModelHighAPI_Integer.h"
110 %include "ModelHighAPI_Interface.h"
111 %include "ModelHighAPI_Macro.h"
112 %include "ModelHighAPI_RefAttr.h"
113 %include "ModelHighAPI_Selection.h"
114 %include "ModelHighAPI_Tools.h"