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