Salome HOME
Added a selection attribute and naming basic mechanisms
[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_Data.h"
12   #include "ModelAPI_Attribute.h"
13   #include "ModelAPI_AttributeDocRef.h"
14   #include "ModelAPI_AttributeDouble.h"
15   #include "ModelAPI_AttributeInteger.h"
16   #include "ModelAPI_AttributeString.h"
17   #include "ModelAPI_AttributeReference.h"
18   #include "ModelAPI_AttributeRefAttr.h"
19   #include "ModelAPI_AttributeSelection.h"
20   #include "ModelAPI_Validator.h"
21   #include "ModelAPI_AttributeRefList.h"
22   #include "ModelAPI_AttributeBoolean.h"
23   #include "ModelAPI_Result.h"
24   #include "ModelAPI_ResultConstruction.h"
25   #include "ModelAPI_ResultBody.h"
26   #include "ModelAPI_ResultPart.h"
27   
28   template<class T> boost::shared_ptr<T> castTo(boost::shared_ptr<ModelAPI_Result> theObject) 
29   { 
30     return boost::dynamic_pointer_cast<T>(theObject); 
31   }
32   
33    
34 %}
35
36 // to avoid error on this
37 #define MODELAPI_EXPORT
38 #define GEOMAPI_EXPORT
39
40 // standard definitions
41 %include "typemaps.i"
42 %include "std_string.i"
43 %include "std_list.i"
44
45 // boost pointers
46 %include <boost_shared_ptr.i>
47 // For ModelAPI_ResultConstruction.shape()
48 %shared_ptr(GeomAPI_Interface)
49 %shared_ptr(GeomAPI_Shape)
50 %shared_ptr(ModelAPI_Document)
51 %shared_ptr(ModelAPI_Session)
52 %shared_ptr(ModelAPI_Object)
53 %shared_ptr(ModelAPI_Feature)
54 %shared_ptr(ModelAPI_Data)
55 %shared_ptr(ModelAPI_Attribute)
56 %shared_ptr(ModelAPI_AttributeDocRef)
57 %shared_ptr(ModelAPI_AttributeDouble)
58 %shared_ptr(ModelAPI_AttributeInteger)
59 %shared_ptr(ModelAPI_AttributeString)
60 %shared_ptr(ModelAPI_AttributeReference)
61 %shared_ptr(ModelAPI_AttributeRefAttr)
62 %shared_ptr(ModelAPI_AttributeRefList)
63 %shared_ptr(ModelAPI_AttributeBoolean)
64 %shared_ptr(ModelAPI_AttributeSelection)
65 %shared_ptr(ModelAPI_Result)
66 %shared_ptr(ModelAPI_ResultConstruction)
67 %shared_ptr(ModelAPI_ResultBody)
68 %shared_ptr(ModelAPI_ResultPart)
69
70 // all supported interfaces
71 %include "GeomAPI_Interface.h"
72 %include "GeomAPI_Shape.h"
73 %include "ModelAPI_Document.h"
74 %include "ModelAPI_Session.h"
75 %include "ModelAPI_Object.h"
76 %include "ModelAPI_Feature.h"
77 %include "ModelAPI_Data.h"
78 %include "ModelAPI_Attribute.h"
79 %include "ModelAPI_AttributeDocRef.h"
80 %include "ModelAPI_AttributeDouble.h"
81 %include "ModelAPI_AttributeInteger.h"
82 %include "ModelAPI_AttributeString.h"
83 %include "ModelAPI_AttributeReference.h"
84 %include "ModelAPI_AttributeRefAttr.h"
85 %include "ModelAPI_AttributeBoolean.h"
86 %include "ModelAPI_AttributeSelection.h"
87 %include "ModelAPI_AttributeRefList.h"
88 %include "ModelAPI_Validator.h"
89 %include "ModelAPI_Result.h"
90 %include "ModelAPI_ResultConstruction.h"
91 %include "ModelAPI_ResultBody.h"
92 %include "ModelAPI_ResultPart.h"
93
94 %template(ObjectList) std::list<boost::shared_ptr<ModelAPI_Object> >;
95 %template(ResultList) std::list<boost::shared_ptr<ModelAPI_Result> >;
96
97 template<class T> boost::shared_ptr<T> castTo(boost::shared_ptr<ModelAPI_Result> theObject);
98 %template(modelAPI_ResultConstruction) castTo<ModelAPI_ResultConstruction>;
99 %template(modelAPI_ResultBody) castTo<ModelAPI_ResultBody>;
100 %template(modelAPI_ResultPart) castTo<ModelAPI_ResultPart>;