2 %module(directors="1") ModelAPI
3 %feature("director:except") {
6 std::cerr << std::endl;
7 throw Swig::DirectorMethodException();
13 #include "ModelAPI_Entity.h"
14 #include "ModelAPI_Document.h"
15 #include "ModelAPI_Session.h"
16 #include "ModelAPI_Object.h"
17 #include "ModelAPI_Feature.h"
18 #include "ModelAPI_Plugin.h"
19 #include "ModelAPI_CompositeFeature.h"
20 #include "ModelAPI_Data.h"
21 #include "ModelAPI_Attribute.h"
22 #include "ModelAPI_AttributeDocRef.h"
23 #include "ModelAPI_AttributeDouble.h"
24 #include "ModelAPI_AttributeInteger.h"
25 #include "ModelAPI_AttributeString.h"
26 #include "ModelAPI_AttributeReference.h"
27 #include "ModelAPI_AttributeRefAttr.h"
28 #include "ModelAPI_AttributeSelection.h"
29 #include "ModelAPI_AttributeSelectionList.h"
30 #include "ModelAPI_AttributeValidator.h"
31 #include "ModelAPI_Validator.h"
32 #include "ModelAPI_FeatureValidator.h"
33 #include "ModelAPI_AttributeRefList.h"
34 #include "ModelAPI_AttributeBoolean.h"
35 #include "ModelAPI_Result.h"
36 #include "ModelAPI_ResultConstruction.h"
37 #include "ModelAPI_ResultBody.h"
38 #include "ModelAPI_ResultPart.h"
39 #include "ModelAPI_ResultParameter.h"
40 #include "ModelAPI_ResultGroup.h"
41 #include "ModelAPI_Tools.h"
42 #include "ModelAPI_ResultCompSolid.h"
47 template<class T1, class T2>
48 std::shared_ptr<T1> shared_ptr_cast(std::shared_ptr<T2> theObject)
50 return std::dynamic_pointer_cast<T1>(theObject);
55 // to avoid error on this
56 #define MODELAPI_EXPORT
58 // standard definitions
61 %include "std_string.i"
63 %include "std_shared_ptr.i"
66 %feature("director") ModelAPI_Plugin;
67 %feature("director") ModelAPI_Object;
68 %feature("director") ModelAPI_Feature;
69 %feature("director") ModelAPI_CompositeFeature;
70 %feature("director") ModelAPI_Data;
73 // For ModelAPI_ResultConstruction.shape()
74 %shared_ptr(ModelAPI_Entity)
75 %shared_ptr(ModelAPI_Document)
76 %shared_ptr(ModelAPI_Session)
77 %shared_ptr(ModelAPI_Plugin)
78 %shared_ptr(ModelAPI_Object)
79 %shared_ptr(ModelAPI_Feature)
80 %shared_ptr(ModelAPI_CompositeFeature)
81 %shared_ptr(ModelAPI_Data)
82 %shared_ptr(ModelAPI_Attribute)
83 %shared_ptr(ModelAPI_AttributeDocRef)
84 %shared_ptr(ModelAPI_AttributeDouble)
85 %shared_ptr(ModelAPI_AttributeInteger)
86 %shared_ptr(ModelAPI_AttributeString)
87 %shared_ptr(ModelAPI_AttributeReference)
88 %shared_ptr(ModelAPI_AttributeRefAttr)
89 %shared_ptr(ModelAPI_AttributeRefList)
90 %shared_ptr(ModelAPI_AttributeBoolean)
91 %shared_ptr(ModelAPI_AttributeSelection)
92 %shared_ptr(ModelAPI_AttributeSelectionList)
93 %shared_ptr(ModelAPI_Validator)
94 %shared_ptr(ModelAPI_AttributeValidator)
95 %shared_ptr(ModelAPI_FeatureValidator)
96 %shared_ptr(ModelAPI_Result)
97 %shared_ptr(ModelAPI_ResultConstruction)
98 %shared_ptr(ModelAPI_ResultBody)
99 %shared_ptr(ModelAPI_ResultPart)
100 %shared_ptr(ModelAPI_ResultGroup)
101 %shared_ptr(ModelAPI_ResultParameter)
102 %shared_ptr(ModelAPI_ResultCompSolid)
104 // all supported interfaces
105 %include "ModelAPI_Entity.h"
106 %include "ModelAPI_Document.h"
107 %include "ModelAPI_Session.h"
108 %include "ModelAPI_Plugin.h"
109 %include "ModelAPI_Object.h"
110 %include "ModelAPI_Feature.h"
111 %include "ModelAPI_CompositeFeature.h"
112 %include "ModelAPI_Data.h"
113 %include "ModelAPI_Attribute.h"
114 %include "ModelAPI_AttributeDocRef.h"
115 %include "ModelAPI_AttributeDouble.h"
116 %include "ModelAPI_AttributeInteger.h"
117 %include "ModelAPI_AttributeString.h"
118 %include "ModelAPI_AttributeReference.h"
119 %include "ModelAPI_AttributeRefAttr.h"
120 %include "ModelAPI_AttributeBoolean.h"
121 %include "ModelAPI_AttributeSelection.h"
122 %include "ModelAPI_AttributeSelectionList.h"
123 %include "ModelAPI_AttributeRefList.h"
124 %include "ModelAPI_Validator.h"
125 %include "ModelAPI_AttributeValidator.h"
126 %include "ModelAPI_FeatureValidator.h"
127 %include "ModelAPI_Result.h"
128 %include "ModelAPI_ResultConstruction.h"
129 %include "ModelAPI_ResultBody.h"
130 %include "ModelAPI_ResultPart.h"
131 %include "ModelAPI_ResultGroup.h"
132 %include "ModelAPI_ResultParameter.h"
133 %include "ModelAPI_Tools.h"
134 %include "ModelAPI_ResultCompSolid.h"
137 %template(ObjectList) std::list<std::shared_ptr<ModelAPI_Object> >;
138 %template(ResultList) std::list<std::shared_ptr<ModelAPI_Result> >;
139 %template(DocumentList) std::list<std::shared_ptr<ModelAPI_Document> >;
141 // std::dynamic_pointer_cast
142 template<class T1, class T2> std::shared_ptr<T1> shared_ptr_cast(std::shared_ptr<T2> theObject);
143 %template(featureToCompositeFeature) shared_ptr_cast<ModelAPI_CompositeFeature, ModelAPI_Feature>;
144 %template(objectToFeature) shared_ptr_cast<ModelAPI_Feature, ModelAPI_Object>;
145 %template(compositeFeatureToFeature) shared_ptr_cast<ModelAPI_Feature, ModelAPI_CompositeFeature>;
147 %template(modelAPI_Result) shared_ptr_cast<ModelAPI_Result, ModelAPI_Object>;
148 %template(modelAPI_ResultConstruction) shared_ptr_cast<ModelAPI_ResultConstruction, ModelAPI_Result>;
149 %template(modelAPI_ResultBody) shared_ptr_cast<ModelAPI_ResultBody, ModelAPI_Result>;
150 %template(modelAPI_ResultPart) shared_ptr_cast<ModelAPI_ResultPart, ModelAPI_Result>;
151 %template(modelAPI_ResultParameter) shared_ptr_cast<ModelAPI_ResultParameter, ModelAPI_Result>;
152 %template(modelAPI_ResultGroup) shared_ptr_cast<ModelAPI_ResultPart, ModelAPI_ResultGroup>;
153 %template(modelAPI_ResultCompSolid) shared_ptr_cast<ModelAPI_ResultCompSolid, ModelAPI_ResultBody>;
156 %template(modelAPI_AttributeDocRef) shared_ptr_cast<ModelAPI_AttributeDocRef, ModelAPI_Attribute>;
157 %template(modelAPI_AttributeDouble) shared_ptr_cast<ModelAPI_AttributeDouble, ModelAPI_Attribute>;
158 %template(modelAPI_AttributeInteger) shared_ptr_cast<ModelAPI_AttributeInteger, ModelAPI_Attribute>;
159 %template(modelAPI_AttributeString) shared_ptr_cast<ModelAPI_AttributeString, ModelAPI_Attribute>;
160 %template(modelAPI_AttributeReference) shared_ptr_cast<ModelAPI_AttributeReference, ModelAPI_Attribute>;
161 %template(modelAPI_AttributeRefAttr) shared_ptr_cast<ModelAPI_AttributeRefAttr, ModelAPI_Attribute>;
162 %template(modelAPI_AttributeBoolean) shared_ptr_cast<ModelAPI_AttributeBoolean, ModelAPI_Attribute>;
163 %template(modelAPI_AttributeSelection) shared_ptr_cast<ModelAPI_AttributeSelection, ModelAPI_Attribute>;
164 %template(modelAPI_AttributeSelectionList) shared_ptr_cast<ModelAPI_AttributeSelectionList, ModelAPI_Attribute>;
165 %template(modelAPI_AttributeRefList) shared_ptr_cast<ModelAPI_AttributeRefList, ModelAPI_Attribute>;