]> SALOME platform Git repositories - modules/shaper.git/blob - src/SketchAPI/SketchAPI.i
Salome HOME
c81ea84ef360c2dcc4d99014a0617ec36df6adf4
[modules/shaper.git] / src / SketchAPI / SketchAPI.i
1 /* SketchAPI.i */
2
3 %module SketchAPI
4
5 %{
6   #include "SketchAPI_swig.h"
7 %}
8
9 %include "doxyhelp.i"
10
11 // import other modules
12 %import "ModelHighAPI.i"
13
14 // to avoid error on this
15 #define SKETCHAPI_EXPORT
16
17 // standard definitions
18 %include "typemaps.i"
19 %include "std_list.i"
20 %include "std_shared_ptr.i"
21
22 // shared pointers
23 %shared_ptr(SketchAPI_Arc)
24 %shared_ptr(SketchAPI_Circle)
25 %shared_ptr(SketchAPI_Constraint)
26 %shared_ptr(SketchAPI_IntersectionPoint)
27 %shared_ptr(SketchAPI_Line)
28 %shared_ptr(SketchAPI_Mirror)
29 %shared_ptr(SketchAPI_Sketch)
30 %shared_ptr(SketchAPI_SketchEntity)
31 %shared_ptr(SketchAPI_Point)
32 %shared_ptr(SketchAPI_Projection)
33 %shared_ptr(SketchAPI_Rectangle)
34 %shared_ptr(SketchAPI_Rotation)
35 %shared_ptr(SketchAPI_Translation)
36
37 %typemap(in) const ModelHighAPI_RefAttr & (ModelHighAPI_RefAttr temp) {
38   std::shared_ptr<ModelAPI_Attribute> * temp_attribute;
39   std::shared_ptr<ModelAPI_Object> * temp_object;
40   std::shared_ptr<ModelHighAPI_Interface> * temp_interface;
41   ModelHighAPI_Selection* temp_selection;
42   int newmem = 0;
43   if ((SWIG_ConvertPtrAndOwn($input, (void **)&temp_selection, $descriptor(ModelHighAPI_Selection*), SWIG_POINTER_EXCEPTION, &newmem)) == 0) {
44     if (!temp_selection) {
45       PyErr_SetString(PyExc_TypeError, "argument must be ModelHighAPI_RefAttr, ModelHighAPI_Selection, ModelHighAPI_Interface, ModelAPI_Attribute or ModelAPI_Object.");
46       return NULL;
47     }
48     temp = ModelHighAPI_RefAttr(temp_selection->resultSubShapePair().first);
49     if (newmem & SWIG_CAST_NEW_MEMORY) {
50       delete temp_selection;
51     }
52     $1 = &temp;
53   } else
54   if ((SWIG_ConvertPtrAndOwn($input, (void **)&temp_attribute, $descriptor(std::shared_ptr<ModelAPI_Attribute> *), SWIG_POINTER_EXCEPTION, &newmem)) == 0) {
55     if (!temp_attribute) {
56       PyErr_SetString(PyExc_TypeError, "argument must be ModelHighAPI_RefAttr, ModelHighAPI_Selection, ModelHighAPI_Interface, ModelAPI_Attribute or ModelAPI_Object.");
57       return NULL;
58     }
59     temp = ModelHighAPI_RefAttr(*temp_attribute);
60     if (newmem & SWIG_CAST_NEW_MEMORY) {
61       delete temp_attribute;
62     }
63     $1 = &temp;
64   } else
65   if ((SWIG_ConvertPtrAndOwn($input, (void **)&temp_object, $descriptor(std::shared_ptr<ModelAPI_Object> *), SWIG_POINTER_EXCEPTION, &newmem)) == 0) {
66     if (!temp_object) {
67       PyErr_SetString(PyExc_TypeError, "argument must be ModelHighAPI_RefAttr, ModelHighAPI_Selection, ModelHighAPI_Interface, ModelAPI_Attribute or ModelAPI_Object.");
68       return NULL;
69     }
70     temp = ModelHighAPI_RefAttr(*temp_object);
71     if (newmem & SWIG_CAST_NEW_MEMORY) {
72       delete temp_object;
73     }
74     $1 = &temp;
75   } else
76   if ((SWIG_ConvertPtrAndOwn($input, (void **)&temp_interface, $descriptor(std::shared_ptr<ModelHighAPI_Interface> *), SWIG_POINTER_EXCEPTION, &newmem)) == 0) {
77     if (!temp_interface) {
78       PyErr_SetString(PyExc_TypeError, "argument must be ModelHighAPI_RefAttr, ModelHighAPI_Selection, ModelHighAPI_Interface, ModelAPI_Attribute or ModelAPI_Object.");
79       return NULL;
80     }
81     temp = ModelHighAPI_RefAttr(*temp_interface);
82     if (newmem & SWIG_CAST_NEW_MEMORY) {
83       delete temp_interface;
84     }
85     $1 = &temp;
86   } else
87   if ((SWIG_ConvertPtr($input, (void **)&$1, $1_descriptor, SWIG_POINTER_EXCEPTION)) == 0) {
88   } else {
89     PyErr_SetString(PyExc_TypeError, "argument must be ModelHighAPI_RefAttr, ModelHighAPI_Selection, ModelHighAPI_Interface, ModelAPI_Attribute or ModelAPI_Object.");
90     return NULL;
91   }
92 }
93
94 // all supported interfaces (the order is very important according dependencies: base class first)
95 %include "SketchAPI_SketchEntity.h"
96 %include "SketchAPI_Point.h"
97 %include "SketchAPI_IntersectionPoint.h"
98 %include "SketchAPI_Line.h"
99 %include "SketchAPI_Circle.h"
100 %include "SketchAPI_Arc.h"
101 %include "SketchAPI_Projection.h"
102 %include "SketchAPI_Mirror.h"
103 %include "SketchAPI_Translation.h"
104 %include "SketchAPI_Rectangle.h"
105 %include "SketchAPI_Rotation.h"
106 %include "SketchAPI_Sketch.h"
107 %include "SketchAPI_Constraint.h"