Salome HOME
Merge branch 'master' of newgeom:newgeom
[modules/shaper.git] / src / GeomDataAPI / GeomDataAPI.i
1 /* GeomDataAPI.i */
2 %module GeomDataAPI
3 %{
4   #include <boost/shared_ptr.hpp>
5
6   #include "ModelAPI_Attribute.h"
7   #include "GeomDataAPI.h"
8   #include "GeomDataAPI_Point.h"
9   #include "GeomDataAPI_Dir.h"
10   #include "GeomDataAPI_Point2D.h"
11   
12   template<class T> boost::shared_ptr<T> castTo(boost::shared_ptr<ModelAPI_Attribute> theObject) 
13   { 
14     return boost::dynamic_pointer_cast<T>(theObject); 
15   } 
16 %}
17
18 // to avoid error on this
19 #define GEOMDATAAPI_EXPORT
20 #define MODELAPI_EXPORT
21
22 // standard definitions
23 %include "typemaps.i"
24 %include "std_string.i"
25 %include "std_list.i"
26
27 // boost pointers
28 %include <boost_shared_ptr.i>
29 %shared_ptr(ModelAPI_Attribute)
30 %shared_ptr(GeomDataAPI_Point)
31 %shared_ptr(GeomDataAPI_Dir)
32 %shared_ptr(GeomDataAPI_Point2D)
33
34 // all supported interfaces
35 %include "ModelAPI_Attribute.h"
36 %include "GeomDataAPI_Point.h"
37 %include "GeomDataAPI_Dir.h"
38 %include "GeomDataAPI_Point2D.h"
39
40 template<class T> boost::shared_ptr<T> castTo(boost::shared_ptr<ModelAPI_Attribute> theObject);
41 %template(geomDataAPI_Point) castTo<GeomDataAPI_Point>;
42 %template(geomDataAPI_Dir) castTo<GeomDataAPI_Dir>;
43 %template(geomDataAPI_Point2D) castTo<GeomDataAPI_Point2D>;