Salome HOME
Merge branch 'Dev_0.6.1' of newgeom:newgeom into Dev_0.6.1
[modules/shaper.git] / src / ModelAPI / ModelAPI.i
1 /* ModelAPI.i */
2 %module 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_CompositeFeature.h"
12   #include "ModelAPI_Data.h"
13   #include "ModelAPI_Attribute.h"
14   #include "ModelAPI_AttributeDocRef.h"
15   #include "ModelAPI_AttributeDouble.h"
16   #include "ModelAPI_AttributeInteger.h"
17   #include "ModelAPI_AttributeString.h"
18   #include "ModelAPI_AttributeReference.h"
19   #include "ModelAPI_AttributeRefAttr.h"
20   #include "ModelAPI_AttributeSelection.h"
21   #include "ModelAPI_AttributeSelectionList.h"
22   #include "ModelAPI_AttributeValidator.h"
23   #include "ModelAPI_Validator.h"
24   #include "ModelAPI_FeatureValidator.h"
25   #include "ModelAPI_AttributeRefList.h"
26   #include "ModelAPI_AttributeBoolean.h"
27   #include "ModelAPI_Result.h"
28   #include "ModelAPI_ResultConstruction.h"
29   #include "ModelAPI_ResultBody.h"
30   #include "ModelAPI_ResultPart.h"
31   #include "ModelAPI_ResultParameters.h"
32   #include "ModelAPI_ResultGroup.h"
33   #include "ModelAPI_Tools.h"
34   
35   template<class T1, class T2> 
36   std::shared_ptr<T1> shared_ptr_cast(std::shared_ptr<T2> theObject)
37   { 
38     return std::dynamic_pointer_cast<T1>(theObject); 
39   }
40   
41 %}
42
43 // to avoid error on this
44 #define MODELAPI_EXPORT
45 #define GEOMAPI_EXPORT
46
47 // standard definitions
48 %include "typemaps.i"
49 %include "std_string.i"
50 %include "std_list.i"
51 %include "std_shared_ptr.i"
52
53 // shared pointers
54 // For ModelAPI_ResultConstruction.shape()
55 %shared_ptr(GeomAPI_Interface)
56 %shared_ptr(GeomAPI_Shape)
57 %shared_ptr(ModelAPI_Document)
58 %shared_ptr(ModelAPI_Session)
59 %shared_ptr(ModelAPI_Object)
60 %shared_ptr(ModelAPI_Feature)
61 %shared_ptr(ModelAPI_CompositeFeature)
62 %shared_ptr(ModelAPI_Data)
63 %shared_ptr(ModelAPI_Attribute)
64 %shared_ptr(ModelAPI_AttributeDocRef)
65 %shared_ptr(ModelAPI_AttributeDouble)
66 %shared_ptr(ModelAPI_AttributeInteger)
67 %shared_ptr(ModelAPI_AttributeString)
68 %shared_ptr(ModelAPI_AttributeReference)
69 %shared_ptr(ModelAPI_AttributeRefAttr)
70 %shared_ptr(ModelAPI_AttributeRefList)
71 %shared_ptr(ModelAPI_AttributeBoolean)
72 %shared_ptr(ModelAPI_AttributeSelection)
73 %shared_ptr(ModelAPI_AttributeSelectionList)
74 %shared_ptr(ModelAPI_Validator)
75 %shared_ptr(ModelAPI_AttributeValidator)
76 %shared_ptr(ModelAPI_FeatureValidator)
77 %shared_ptr(ModelAPI_Result)
78 %shared_ptr(ModelAPI_ResultConstruction)
79 %shared_ptr(ModelAPI_ResultBody)
80 %shared_ptr(ModelAPI_ResultPart)
81 %shared_ptr(ModelAPI_ResultGroup)
82 %shared_ptr(ModelAPI_ResultParameters)
83
84 // all supported interfaces
85 %include "GeomAPI_Interface.h"
86 %include "GeomAPI_Shape.h"
87 %include "ModelAPI_Document.h"
88 %include "ModelAPI_Session.h"
89 %include "ModelAPI_Object.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_AttributeValidator.h"
106 %include "ModelAPI_FeatureValidator.h"
107 %include "ModelAPI_Result.h"
108 %include "ModelAPI_ResultConstruction.h"
109 %include "ModelAPI_ResultBody.h"
110 %include "ModelAPI_ResultPart.h"
111 %include "ModelAPI_ResultGroup.h"
112 %include "ModelAPI_ResultParameters.h"
113 %include "ModelAPI_Tools.h"
114
115 %template(ObjectList) std::list<std::shared_ptr<ModelAPI_Object> >;
116 %template(ResultList) std::list<std::shared_ptr<ModelAPI_Result> >;
117 %template(DocumentList) std::list<std::shared_ptr<ModelAPI_Document> >;
118
119 template<class T1, class T2> std::shared_ptr<T1> shared_ptr_cast(std::shared_ptr<T2> theObject);
120 %template(modelAPI_CompositeFeature) shared_ptr_cast<ModelAPI_CompositeFeature, ModelAPI_Feature>;
121 %template(modelAPI_ResultConstruction) shared_ptr_cast<ModelAPI_ResultConstruction, ModelAPI_Result>;
122 %template(modelAPI_ResultBody) shared_ptr_cast<ModelAPI_ResultBody, ModelAPI_Result>;
123 %template(modelAPI_ResultPart) shared_ptr_cast<ModelAPI_ResultPart, ModelAPI_Result>;
124
125