From 2da3db1cb9b04fac1b12f5c0c35c80b1c411a0f7 Mon Sep 17 00:00:00 2001 From: ageay Date: Mon, 16 Sep 2013 15:25:11 +0000 Subject: [PATCH] MEDCouplingMeshServant::_this2 and MEDCouplingMeshServant::_this in swig --- src/MEDCouplingCorba_Swig/MEDCouplingCorba.i | 93 +++++++++++++++----- 1 file changed, 69 insertions(+), 24 deletions(-) diff --git a/src/MEDCouplingCorba_Swig/MEDCouplingCorba.i b/src/MEDCouplingCorba_Swig/MEDCouplingCorba.i index 9f164446b..810035328 100644 --- a/src/MEDCouplingCorba_Swig/MEDCouplingCorba.i +++ b/src/MEDCouplingCorba_Swig/MEDCouplingCorba.i @@ -47,12 +47,12 @@ namespace ParaMEDMEM public: %extend { - static PyObject *_this(const MEDCouplingFieldDouble *cppPointerOfMesh) + static PyObject *_this(const MEDCouplingFieldDouble *cppPointerOfMesh) throw(INTERP_KERNEL::Exception) { return buildServantAndActivate(cppPointerOfMesh); } - static PyObject *_this2(const MEDCouplingFieldDouble *cppPointerOfMesh) + static PyObject *_this2(const MEDCouplingFieldDouble *cppPointerOfMesh) throw(INTERP_KERNEL::Exception) { return buildServantAndActivate2(cppPointerOfMesh); } @@ -64,12 +64,12 @@ namespace ParaMEDMEM public: %extend { - static PyObject *_this(const MEDCouplingFieldTemplate *cppPointerOfMesh) + static PyObject *_this(const MEDCouplingFieldTemplate *cppPointerOfMesh) throw(INTERP_KERNEL::Exception) { return buildServantAndActivate(cppPointerOfMesh); } - static PyObject *_this2(const MEDCouplingFieldTemplate *cppPointerOfMesh) + static PyObject *_this2(const MEDCouplingFieldTemplate *cppPointerOfMesh) throw(INTERP_KERNEL::Exception) { return buildServantAndActivate2(cppPointerOfMesh); } @@ -81,12 +81,12 @@ namespace ParaMEDMEM public: %extend { - static PyObject *_this(const MEDCouplingMultiFields *cppPointerOfMesh) + static PyObject *_this(const MEDCouplingMultiFields *cppPointerOfMesh) throw(INTERP_KERNEL::Exception) { return buildServantAndActivate(cppPointerOfMesh); } - static PyObject *_this2(const MEDCouplingMultiFields *cppPointerOfMesh) + static PyObject *_this2(const MEDCouplingMultiFields *cppPointerOfMesh) throw(INTERP_KERNEL::Exception) { return buildServantAndActivate2(cppPointerOfMesh); } @@ -98,29 +98,74 @@ namespace ParaMEDMEM public: %extend { - static PyObject *_this(const MEDCouplingFieldOverTime *cppPointerOfMesh) + static PyObject *_this(const MEDCouplingFieldOverTime *cppPointerOfMesh) throw(INTERP_KERNEL::Exception) { return buildServantAndActivate(cppPointerOfMesh); } - static PyObject *_this2(const MEDCouplingFieldOverTime *cppPointerOfMesh) + static PyObject *_this2(const MEDCouplingFieldOverTime *cppPointerOfMesh) throw(INTERP_KERNEL::Exception) { return buildServantAndActivate2(cppPointerOfMesh); } } }; + class MEDCouplingMeshServant + { + public: + %extend + { + static PyObject *_this(const MEDCouplingMesh *cppPointerOfMesh) throw(INTERP_KERNEL::Exception) + { + if(!cppPointerOfMesh) + throw INTERP_KERNEL::Exception("MEDCouplingMeshServant::_this : input pointer is NULL !"); + if(dynamic_cast(cppPointerOfMesh)) + return buildServantAndActivate(dynamic_cast(cppPointerOfMesh)); + if(dynamic_cast(cppPointerOfMesh)) + return buildServantAndActivate(dynamic_cast(cppPointerOfMesh)); + if(dynamic_cast(cppPointerOfMesh)) + return buildServantAndActivate(dynamic_cast(cppPointerOfMesh)); + if(dynamic_cast(cppPointerOfMesh)) + return buildServantAndActivate(dynamic_cast(cppPointerOfMesh)); + if(dynamic_cast(cppPointerOfMesh)) + return buildServantAndActivate(dynamic_cast(cppPointerOfMesh)); + if(dynamic_cast(cppPointerOfMesh)) + return buildServantAndActivate(dynamic_cast(cppPointerOfMesh)); + throw INTERP_KERNEL::Exception("MEDCouplingMeshServant::_this : unrecognized type (or not managed type) of Mesh in input !"); + } + + static PyObject *_this2(const MEDCouplingMesh *cppPointerOfMesh) throw(INTERP_KERNEL::Exception) + { + if(!cppPointerOfMesh) + throw INTERP_KERNEL::Exception("MEDCouplingMeshServant::_this2 : input pointer is NULL !"); + if(dynamic_cast(cppPointerOfMesh)) + return buildServantAndActivate2(dynamic_cast(cppPointerOfMesh)); + if(dynamic_cast(cppPointerOfMesh)) + return buildServantAndActivate2(dynamic_cast(cppPointerOfMesh)); + if(dynamic_cast(cppPointerOfMesh)) + return buildServantAndActivate2(dynamic_cast(cppPointerOfMesh)); + if(dynamic_cast(cppPointerOfMesh)) + return buildServantAndActivate2(dynamic_cast(cppPointerOfMesh)); + if(dynamic_cast(cppPointerOfMesh)) + return buildServantAndActivate2(dynamic_cast(cppPointerOfMesh)); + if(dynamic_cast(cppPointerOfMesh)) + return buildServantAndActivate2(dynamic_cast(cppPointerOfMesh)); + throw INTERP_KERNEL::Exception("MEDCouplingMeshServant::_this2 : unrecognized type (or not managed type) of Mesh in input !"); + } + } + }; + class MEDCouplingUMeshServant { public: %extend { - static PyObject *_this(const MEDCouplingUMesh *cppPointerOfMesh) + static PyObject *_this(const MEDCouplingUMesh *cppPointerOfMesh) throw(INTERP_KERNEL::Exception) { return buildServantAndActivate(cppPointerOfMesh); } - static PyObject *_this2(const MEDCouplingUMesh *cppPointerOfMesh) + static PyObject *_this2(const MEDCouplingUMesh *cppPointerOfMesh) throw(INTERP_KERNEL::Exception) { return buildServantAndActivate2(cppPointerOfMesh); } @@ -132,12 +177,12 @@ namespace ParaMEDMEM public: %extend { - static PyObject *_this(const MEDCoupling1SGTUMesh *cppPointerOfMesh) + static PyObject *_this(const MEDCoupling1SGTUMesh *cppPointerOfMesh) throw(INTERP_KERNEL::Exception) { return buildServantAndActivate(cppPointerOfMesh); } - static PyObject *_this2(const MEDCoupling1SGTUMesh *cppPointerOfMesh) + static PyObject *_this2(const MEDCoupling1SGTUMesh *cppPointerOfMesh) throw(INTERP_KERNEL::Exception) { return buildServantAndActivate2(cppPointerOfMesh); } @@ -149,12 +194,12 @@ namespace ParaMEDMEM public: %extend { - static PyObject *_this(const MEDCoupling1DGTUMesh *cppPointerOfMesh) + static PyObject *_this(const MEDCoupling1DGTUMesh *cppPointerOfMesh) throw(INTERP_KERNEL::Exception) { return buildServantAndActivate(cppPointerOfMesh); } - static PyObject *_this2(const MEDCoupling1DGTUMesh *cppPointerOfMesh) + static PyObject *_this2(const MEDCoupling1DGTUMesh *cppPointerOfMesh) throw(INTERP_KERNEL::Exception) { return buildServantAndActivate2(cppPointerOfMesh); } @@ -166,12 +211,12 @@ namespace ParaMEDMEM public: %extend { - static PyObject *_this(const MEDCouplingExtrudedMesh *cppPointerOfMesh) + static PyObject *_this(const MEDCouplingExtrudedMesh *cppPointerOfMesh) throw(INTERP_KERNEL::Exception) { return buildServantAndActivate(cppPointerOfMesh); } - static PyObject *_this2(const MEDCouplingExtrudedMesh *cppPointerOfMesh) + static PyObject *_this2(const MEDCouplingExtrudedMesh *cppPointerOfMesh) throw(INTERP_KERNEL::Exception) { return buildServantAndActivate2(cppPointerOfMesh); } @@ -183,12 +228,12 @@ namespace ParaMEDMEM public: %extend { - static PyObject *_this(const MEDCouplingCMesh *cppPointerOfMesh) + static PyObject *_this(const MEDCouplingCMesh *cppPointerOfMesh) throw(INTERP_KERNEL::Exception) { return buildServantAndActivate(cppPointerOfMesh); } - static PyObject *_this2(const MEDCouplingCMesh *cppPointerOfMesh) + static PyObject *_this2(const MEDCouplingCMesh *cppPointerOfMesh) throw(INTERP_KERNEL::Exception) { return buildServantAndActivate2(cppPointerOfMesh); } @@ -200,12 +245,12 @@ namespace ParaMEDMEM public: %extend { - static PyObject *_this(const MEDCouplingCurveLinearMesh *cppPointerOfMesh) + static PyObject *_this(const MEDCouplingCurveLinearMesh *cppPointerOfMesh) throw(INTERP_KERNEL::Exception) { return buildServantAndActivate(cppPointerOfMesh); } - static PyObject *_this2(const MEDCouplingCurveLinearMesh *cppPointerOfMesh) + static PyObject *_this2(const MEDCouplingCurveLinearMesh *cppPointerOfMesh) throw(INTERP_KERNEL::Exception) { return buildServantAndActivate2(cppPointerOfMesh); } @@ -217,12 +262,12 @@ namespace ParaMEDMEM public: %extend { - static PyObject *_this(const DataArrayDouble *cppPointerOfMesh) + static PyObject *_this(const DataArrayDouble *cppPointerOfMesh) throw(INTERP_KERNEL::Exception) { return buildServantAndActivate(cppPointerOfMesh); } - static PyObject *_this2(const DataArrayDouble *cppPointerOfMesh) + static PyObject *_this2(const DataArrayDouble *cppPointerOfMesh) throw(INTERP_KERNEL::Exception) { return buildServantAndActivate2(cppPointerOfMesh); } @@ -234,12 +279,12 @@ namespace ParaMEDMEM public: %extend { - static PyObject *_this(const DataArrayInt *cppPointerOfMesh) + static PyObject *_this(const DataArrayInt *cppPointerOfMesh) throw(INTERP_KERNEL::Exception) { return buildServantAndActivate(cppPointerOfMesh); } - static PyObject *_this2(const DataArrayInt *cppPointerOfMesh) + static PyObject *_this2(const DataArrayInt *cppPointerOfMesh) throw(INTERP_KERNEL::Exception) { return buildServantAndActivate2(cppPointerOfMesh); } -- 2.39.2