6 #include "SketchAPI_swig.h"
11 // import other modules
12 %import "ModelHighAPI.i"
14 // to avoid error on this
15 #define SKETCHAPI_EXPORT
17 // standard definitions
20 %include "std_shared_ptr.i"
23 %shared_ptr(SketchAPI_Arc)
24 %shared_ptr(SketchAPI_Circle)
25 %shared_ptr(SketchAPI_Line)
26 %shared_ptr(SketchAPI_Sketch)
27 %shared_ptr(SketchAPI_SketchEntity)
28 %shared_ptr(SketchAPI_Point)
30 // fix compilarion error: ‘res2’ was not declared in this scope
31 %typemap(freearg) const std::list<ModelHighAPI_RefAttr> & {}
33 %typemap(in) const std::list<ModelHighAPI_RefAttr> & (std::list<ModelHighAPI_RefAttr> temp) {
34 std::shared_ptr<ModelAPI_Attribute> * temp_attribute;
36 if (PySequence_Check($input)) {
37 for (Py_ssize_t i = 0; i < PySequence_Size($input); ++i) {
38 PyObject * item = PySequence_GetItem($input, i);
39 if ((SWIG_ConvertPtrAndOwn(item, (void **)&temp_attribute, $descriptor(std::shared_ptr<ModelAPI_Attribute> *), SWIG_POINTER_EXCEPTION, &newmem)) == 0) {
40 if (!temp_attribute) {
41 PyErr_SetString(PyExc_TypeError, "argument must be list of ModelHighAPI_RefAttr, ModelHighAPI_Interface, ModelAPI_Attribute or ModelAPI_Object.");
44 temp.push_back(ModelHighAPI_RefAttr(*temp_attribute));
45 if (newmem & SWIG_CAST_NEW_MEMORY) {
46 delete temp_attribute;
53 PyErr_SetString(PyExc_ValueError, "argument must be list of ModelHighAPI_RefAttr, ModelHighAPI_Interface, ModelAPI_Attribute or ModelAPI_Object.");
58 // all supported interfaces (the order is very important according dependencies: base class first)
59 %include "SketchAPI_SketchEntity.h"
60 %include "SketchAPI_Point.h"
61 %include "SketchAPI_Line.h"
62 %include "SketchAPI_Circle.h"
63 %include "SketchAPI_Arc.h"
64 %include "SketchAPI_Sketch.h"