Salome HOME
Merge branch 'master' of newgeom:newgeom.git into BR_PYTHON_PLUGIN
[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 // boost pointers
49 %include <boost_shared_ptr.i>
50 // For ModelAPI_ResultConstruction.shape()
51 %shared_ptr(GeomAPI_Interface)
52 %shared_ptr(GeomAPI_Shape)
53 %shared_ptr(ModelAPI_Document)
54 %shared_ptr(ModelAPI_Session)
55 %shared_ptr(ModelAPI_Object)
56 // %shared_ptr(ModelAPI_Plugin)
57 %shared_ptr(ModelAPI_Feature)
58 %shared_ptr(ModelAPI_CompositeFeature)
59 %shared_ptr(ModelAPI_Data)
60 %shared_ptr(ModelAPI_Attribute)
61 %shared_ptr(ModelAPI_AttributeDocRef)
62 %shared_ptr(ModelAPI_AttributeDouble)
63 %shared_ptr(ModelAPI_AttributeInteger)
64 %shared_ptr(ModelAPI_AttributeString)
65 %shared_ptr(ModelAPI_AttributeReference)
66 %shared_ptr(ModelAPI_AttributeRefAttr)
67 %shared_ptr(ModelAPI_AttributeRefList)
68 %shared_ptr(ModelAPI_AttributeBoolean)
69 %shared_ptr(ModelAPI_AttributeSelection)
70 %shared_ptr(ModelAPI_AttributeSelectionList)
71 %shared_ptr(ModelAPI_Result)
72 %shared_ptr(ModelAPI_ResultConstruction)
73 %shared_ptr(ModelAPI_ResultBody)
74 %shared_ptr(ModelAPI_ResultPart)
75 %feature("director") ModelAPI_Plugin;
76
77 // all supported interfaces
78 %include "GeomAPI_Interface.h"
79 %include "GeomAPI_Shape.h"
80 %include "ModelAPI_Document.h"
81 %include "ModelAPI_Session.h"
82 %include "ModelAPI_Object.h"
83 %include "ModelAPI_Plugin.h"
84 %include "ModelAPI_Feature.h"
85 %include "ModelAPI_CompositeFeature.h"
86 %include "ModelAPI_Data.h"
87 %include "ModelAPI_Attribute.h"
88 %include "ModelAPI_AttributeDocRef.h"
89 %include "ModelAPI_AttributeDouble.h"
90 %include "ModelAPI_AttributeInteger.h"
91 %include "ModelAPI_AttributeString.h"
92 %include "ModelAPI_AttributeReference.h"
93 %include "ModelAPI_AttributeRefAttr.h"
94 %include "ModelAPI_AttributeBoolean.h"
95 %include "ModelAPI_AttributeSelection.h"
96 %include "ModelAPI_AttributeSelectionList.h"
97 %include "ModelAPI_AttributeRefList.h"
98 %include "ModelAPI_Validator.h"
99 %include "ModelAPI_Result.h"
100 %include "ModelAPI_ResultConstruction.h"
101 %include "ModelAPI_ResultBody.h"
102 %include "ModelAPI_ResultPart.h"
103
104 %template(ObjectList) std::list<boost::shared_ptr<ModelAPI_Object> >;
105 %template(ResultList) std::list<boost::shared_ptr<ModelAPI_Result> >;
106
107 template<class T1, class T2> boost::shared_ptr<T1> boost_cast(boost::shared_ptr<T2> theObject);
108 %template(modelAPI_CompositeFeature) boost_cast<ModelAPI_CompositeFeature, ModelAPI_Feature>;
109 %template(modelAPI_ResultConstruction) boost_cast<ModelAPI_ResultConstruction, ModelAPI_Result>;
110 %template(modelAPI_ResultBody) boost_cast<ModelAPI_ResultBody, ModelAPI_Result>;
111 %template(modelAPI_ResultPart) boost_cast<ModelAPI_ResultPart, ModelAPI_Result>;
112
113