/* XdmfPython.cpp: swig -v -c++ -python -o XdmfPython.cpp Xdmf.i */ %module Xdmf %{ // XdmfCore Includes #include #include #include #include #include #include #include #include #include #include #include #include #include // Xdmf Includes #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include %} %import XdmfCore.i %pythoncode { from XdmfCore import * } %typemap(out) boost::shared_ptr { if(boost::shared_ptr attribute = boost::shared_dynamic_cast($1)) { $result = SWIG_NewPointerObj(SWIG_as_voidptr(new boost::shared_ptr(attribute)), SWIGTYPE_p_boost__shared_ptrT_XdmfAttribute_t, SWIG_POINTER_OWN); } else if(boost::shared_ptr domain = boost::shared_dynamic_cast($1)) { $result = SWIG_NewPointerObj(SWIG_as_voidptr(new boost::shared_ptr(domain)), SWIGTYPE_p_boost__shared_ptrT_XdmfDomain_t, SWIG_POINTER_OWN); } else if(boost::shared_ptr geometry = boost::shared_dynamic_cast($1)) { $result = SWIG_NewPointerObj(SWIG_as_voidptr(new boost::shared_ptr(geometry)), SWIGTYPE_p_boost__shared_ptrT_XdmfGeometry_t, SWIG_POINTER_OWN); } else if(boost::shared_ptr grid = boost::shared_dynamic_cast($1)) { $result = SWIG_NewPointerObj(SWIG_as_voidptr(new boost::shared_ptr(grid)), SWIGTYPE_p_boost__shared_ptrT_XdmfGrid_t, SWIG_POINTER_OWN); } else if(boost::shared_ptr gridCollection = boost::shared_dynamic_cast($1)) { $result = SWIG_NewPointerObj(SWIG_as_voidptr(new boost::shared_ptr(gridCollection)), SWIGTYPE_p_boost__shared_ptrT_XdmfGridCollection_t, SWIG_POINTER_OWN); } else if(boost::shared_ptr information = boost::shared_dynamic_cast($1)) { $result = SWIG_NewPointerObj(SWIG_as_voidptr(new boost::shared_ptr(information)), SWIGTYPE_p_boost__shared_ptrT_XdmfInformation_t, SWIG_POINTER_OWN); } else if(boost::shared_ptr set = boost::shared_dynamic_cast($1)) { $result = SWIG_NewPointerObj(SWIG_as_voidptr(new boost::shared_ptr(set)), SWIGTYPE_p_boost__shared_ptrT_XdmfSet_t, SWIG_POINTER_OWN); } else if(boost::shared_ptr time = boost::shared_dynamic_cast($1)) { $result = SWIG_NewPointerObj(SWIG_as_voidptr(new boost::shared_ptr(time)), SWIGTYPE_p_boost__shared_ptrT_XdmfTime_t, SWIG_POINTER_OWN); } else if(boost::shared_ptr topology = boost::shared_dynamic_cast($1)) { $result = SWIG_NewPointerObj(SWIG_as_voidptr(new boost::shared_ptr(topology)), SWIGTYPE_p_boost__shared_ptrT_XdmfTopology_t, SWIG_POINTER_OWN); } else { $result = SWIG_NewPointerObj(SWIG_as_voidptr(new boost::shared_ptr($1)), SWIGTYPE_p_boost__shared_ptrT_XdmfItem_t, SWIG_POINTER_OWN); } } %include std_set.i %template(std_set_uint) std::set; // Abstract Base Classes %template() Loki::Visitor; // Shared Pointer Templates %shared_ptr(XdmfAttribute) %shared_ptr(XdmfAttributeCenter) %shared_ptr(XdmfAttributeType) %shared_ptr(XdmfDomain) %shared_ptr(XdmfGeometry) %shared_ptr(XdmfGeometryType) %shared_ptr(XdmfGrid) %shared_ptr(XdmfGridCollection) %shared_ptr(XdmfGridCollectionType) %shared_ptr(XdmfItemFactory) %shared_ptr(XdmfReader) %shared_ptr(XdmfSet) %shared_ptr(XdmfSetType) %shared_ptr(XdmfTime) %shared_ptr(XdmfTopology) %shared_ptr(XdmfTopologyType) %include XdmfAttribute.hpp %include XdmfAttributeCenter.hpp %include XdmfAttributeType.hpp %include XdmfDomain.hpp %include XdmfGeometry.hpp %include XdmfGeometryType.hpp %include XdmfGrid.hpp %include XdmfGridCollection.hpp %include XdmfGridCollectionType.hpp %include XdmfItemFactory.hpp %include XdmfReader.hpp %include XdmfSet.hpp %include XdmfSetType.hpp %include XdmfTime.hpp %include XdmfTopology.hpp %include XdmfTopologyType.hpp