5 #include "ModelHighAPI_swig.h"
8 #define SWIGPY_SLICE_ARG(obj) ((PySliceObject*)(obj))
13 // import other modules
16 %import "GeomDataAPI.i"
18 // to avoid error on this
19 #define MODELHIGHAPI_EXPORT
21 // standard definitions
24 %include "std_string.i"
25 %include "std_shared_ptr.i"
28 %shared_ptr(ModelHighAPI_Interface)
32 %typemap(in) const ModelHighAPI_Double & (ModelHighAPI_Double temp) {
33 if (PyFloat_Check($input) || PyInt_Check($input) || PyLong_Check($input)) {
34 temp = ModelHighAPI_Double(PyFloat_AsDouble($input));
36 } else if (PyString_Check($input)) {
37 temp = ModelHighAPI_Double(PyString_AsString($input));
39 } else if ((SWIG_ConvertPtr($input, (void **)&$1, $1_descriptor, SWIG_POINTER_EXCEPTION)) == 0) {
41 PyErr_SetString(PyExc_ValueError, "argument must be ModelHighAPI_Double, float, int or string.");
45 %typecheck(SWIG_TYPECHECK_POINTER) ModelHighAPI_Double, const ModelHighAPI_Double & {
46 $1 = (PyFloat_Check($input) || PyInt_Check($input) || PyLong_Check($input) || PyString_Check($input)) ? 1 : 0;
49 %typemap(in) const ModelHighAPI_Integer & (ModelHighAPI_Integer temp) {
50 if (PyInt_Check($input)) {
51 temp = ModelHighAPI_Integer(static_cast<int>(PyInt_AsLong($input)));
53 } else if (PyString_Check($input)) {
54 temp = ModelHighAPI_Integer(PyString_AsString($input));
56 } else if ((SWIG_ConvertPtr($input, (void **)&$1, $1_descriptor, SWIG_POINTER_EXCEPTION)) == 0) {
58 PyErr_SetString(PyExc_ValueError, "argument must be ModelHighAPI_Integer, int or string.");
62 %typecheck(SWIG_TYPECHECK_POINTER) ModelHighAPI_Integer, const ModelHighAPI_Integer & {
63 $1 = (PyInt_Check($input) || PyString_Check($input)) ? 1 : 0;
66 %typemap(in) const ModelHighAPI_RefAttr & (ModelHighAPI_RefAttr temp) {
67 std::shared_ptr<ModelAPI_Attribute> * temp_attribute;
68 std::shared_ptr<ModelAPI_Object> * temp_object;
69 std::shared_ptr<ModelHighAPI_Interface> * temp_interface;
71 if ((SWIG_ConvertPtrAndOwn($input, (void **)&temp_attribute, $descriptor(std::shared_ptr<ModelAPI_Attribute> *), SWIG_POINTER_EXCEPTION, &newmem)) == 0) {
72 if (!temp_attribute) {
73 PyErr_SetString(PyExc_TypeError, "argument must be ModelHighAPI_RefAttr, ModelHighAPI_Interface, ModelAPI_Attribute or ModelAPI_Object.");
76 temp = ModelHighAPI_RefAttr(*temp_attribute);
77 if (newmem & SWIG_CAST_NEW_MEMORY) {
78 delete temp_attribute;
82 if ((SWIG_ConvertPtrAndOwn($input, (void **)&temp_object, $descriptor(std::shared_ptr<ModelAPI_Object> *), SWIG_POINTER_EXCEPTION, &newmem)) == 0) {
84 PyErr_SetString(PyExc_TypeError, "argument must be ModelHighAPI_RefAttr, ModelHighAPI_Interface, ModelAPI_Attribute or ModelAPI_Object.");
87 temp = ModelHighAPI_RefAttr(*temp_object);
88 if (newmem & SWIG_CAST_NEW_MEMORY) {
93 if ((SWIG_ConvertPtrAndOwn($input, (void **)&temp_interface, $descriptor(std::shared_ptr<ModelHighAPI_Interface> *), SWIG_POINTER_EXCEPTION, &newmem)) == 0) {
94 if (!temp_interface) {
95 PyErr_SetString(PyExc_TypeError, "argument must be ModelHighAPI_RefAttr, ModelHighAPI_Interface, ModelAPI_Attribute or ModelAPI_Object.");
98 temp = ModelHighAPI_RefAttr(*temp_interface);
99 if (newmem & SWIG_CAST_NEW_MEMORY) {
100 delete temp_interface;
104 if ((SWIG_ConvertPtr($input, (void **)&$1, $1_descriptor, SWIG_POINTER_EXCEPTION)) == 0) {
106 PyErr_SetString(PyExc_ValueError, "argument must be ModelHighAPI_RefAttr, ModelHighAPI_Interface, ModelAPI_Attribute or ModelAPI_Object.");
111 // all supported interfaces
112 %include "ModelHighAPI_Double.h"
113 %include "ModelHighAPI_Integer.h"
114 %include "ModelHighAPI_Interface.h"
115 %include "ModelHighAPI_RefAttr.h"
116 %include "ModelHighAPI_Selection.h"
117 %include "ModelHighAPI_Macro.h"
118 %include "ModelHighAPI_Tools.h"
120 %template(SelectionList) std::list<ModelHighAPI_Selection>;
121 %template(RefAttrList) std::list<ModelHighAPI_RefAttr>;