]> SALOME platform Git repositories - modules/shaper.git/blob - src/ModelAPI/ModelAPI.i
Salome HOME
The ability to register python plugins added
[modules/shaper.git] / src / ModelAPI / ModelAPI.i
1 /* ModelAPI.i */
2 %module(directors="1") ModelAPI
3 %{
4   #include "GeomAPI_Interface.h"
5   #include "GeomAPI_Shape.h"
6   #include "ModelAPI.h"
7   #include "ModelAPI_Document.h"
8   #include "ModelAPI_Session.h"
9   #include "ModelAPI_Object.h"
10   #include "ModelAPI_Feature.h"
11   #include "ModelAPI_Plugin.h"
12   #include "ModelAPI_CompositeFeature.h"
13   #include "ModelAPI_Data.h"
14   #include "ModelAPI_Attribute.h"
15   #include "ModelAPI_AttributeDocRef.h"
16   #include "ModelAPI_AttributeDouble.h"
17   #include "ModelAPI_AttributeInteger.h"
18   #include "ModelAPI_AttributeString.h"
19   #include "ModelAPI_AttributeReference.h"
20   #include "ModelAPI_AttributeRefAttr.h"
21   #include "ModelAPI_AttributeSelection.h"
22   #include "ModelAPI_AttributeSelectionList.h"
23   #include "ModelAPI_Validator.h"
24   #include "ModelAPI_AttributeRefList.h"
25   #include "ModelAPI_AttributeBoolean.h"
26   #include "ModelAPI_Result.h"
27   #include "ModelAPI_ResultConstruction.h"
28   #include "ModelAPI_ResultBody.h"
29   #include "ModelAPI_ResultPart.h"
30   
31   template<class T1, class T2> 
32   boost::shared_ptr<T1> boost_cast(boost::shared_ptr<T2> theObject)
33   { 
34     return boost::dynamic_pointer_cast<T1>(theObject); 
35   }
36   
37 %}
38
39 // to avoid error on this
40 #define MODELAPI_EXPORT
41 #define GEOMAPI_EXPORT
42
43 // standard definitions
44 %include "typemaps.i"
45 %include "std_string.i"
46 %include "std_list.i"
47
48 // directors
49 %feature("director") ModelAPI_Plugin;
50 // %feature("director") ModelAPI_Object;
51 // %feature("director") ModelAPI_Feature;
52 // %feature("director") ModelAPI_CompositeFeature;
53
54 // boost pointers
55 %include <boost_shared_ptr.i>
56 // For ModelAPI_ResultConstruction.shape()
57 %shared_ptr(GeomAPI_Interface)
58 %shared_ptr(GeomAPI_Shape)
59 %shared_ptr(ModelAPI_Document)
60 %shared_ptr(ModelAPI_Session)
61 %shared_ptr(ModelAPI_Object)
62 // %shared_ptr(ModelAPI_Plugin)
63 %shared_ptr(ModelAPI_Feature)
64 %shared_ptr(ModelAPI_CompositeFeature)
65 %shared_ptr(ModelAPI_Data)
66 %shared_ptr(ModelAPI_Attribute)
67 %shared_ptr(ModelAPI_AttributeDocRef)
68 %shared_ptr(ModelAPI_AttributeDouble)
69 %shared_ptr(ModelAPI_AttributeInteger)
70 %shared_ptr(ModelAPI_AttributeString)
71 %shared_ptr(ModelAPI_AttributeReference)
72 %shared_ptr(ModelAPI_AttributeRefAttr)
73 %shared_ptr(ModelAPI_AttributeRefList)
74 %shared_ptr(ModelAPI_AttributeBoolean)
75 %shared_ptr(ModelAPI_AttributeSelection)
76 %shared_ptr(ModelAPI_AttributeSelectionList)
77 %shared_ptr(ModelAPI_Result)
78 %shared_ptr(ModelAPI_ResultConstruction)
79 %shared_ptr(ModelAPI_ResultBody)
80 %shared_ptr(ModelAPI_ResultPart)
81
82 // all supported interfaces
83 %include "GeomAPI_Interface.h"
84 %include "GeomAPI_Shape.h"
85 %include "ModelAPI_Document.h"
86 %include "ModelAPI_Session.h"
87 %include "ModelAPI_Object.h"
88 // %nodefaultctor ModelAPI_Plugin;
89 %include "ModelAPI_Plugin.h"
90 %include "ModelAPI_Feature.h"
91 %include "ModelAPI_CompositeFeature.h"
92 %include "ModelAPI_Data.h"
93 %include "ModelAPI_Attribute.h"
94 %include "ModelAPI_AttributeDocRef.h"
95 %include "ModelAPI_AttributeDouble.h"
96 %include "ModelAPI_AttributeInteger.h"
97 %include "ModelAPI_AttributeString.h"
98 %include "ModelAPI_AttributeReference.h"
99 %include "ModelAPI_AttributeRefAttr.h"
100 %include "ModelAPI_AttributeBoolean.h"
101 %include "ModelAPI_AttributeSelection.h"
102 %include "ModelAPI_AttributeSelectionList.h"
103 %include "ModelAPI_AttributeRefList.h"
104 %include "ModelAPI_Validator.h"
105 %include "ModelAPI_Result.h"
106 %include "ModelAPI_ResultConstruction.h"
107 %include "ModelAPI_ResultBody.h"
108 %include "ModelAPI_ResultPart.h"
109
110 %template(ObjectList) std::list<boost::shared_ptr<ModelAPI_Object> >;
111 %template(ResultList) std::list<boost::shared_ptr<ModelAPI_Result> >;
112
113 template<class T1, class T2> boost::shared_ptr<T1> boost_cast(boost::shared_ptr<T2> theObject);
114 %template(modelAPI_CompositeFeature) boost_cast<ModelAPI_CompositeFeature, ModelAPI_Feature>;
115 %template(modelAPI_ResultConstruction) boost_cast<ModelAPI_ResultConstruction, ModelAPI_Result>;
116 %template(modelAPI_ResultBody) boost_cast<ModelAPI_ResultBody, ModelAPI_Result>;
117 %template(modelAPI_ResultPart) boost_cast<ModelAPI_ResultPart, ModelAPI_Result>;
118
119