]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
Correction of downcast bug. V5_1_5_BR V5_1_5 V5_1_5_patch02 V5_1_5rc3
authorageay <ageay>
Tue, 16 Nov 2010 10:14:01 +0000 (10:14 +0000)
committerageay <ageay>
Tue, 16 Nov 2010 10:14:01 +0000 (10:14 +0000)
src/MEDCoupling_Swig/MEDCouplingTypemaps.i

index b5d9b2a290d1f448de667c49010d46fbb856ab7e..d1af65ba8c5de44a72e184d3b96bf33215cc5320 100644 (file)
 
 static PyObject* convertMesh(ParaMEDMEM::MEDCouplingMesh* mesh, int owner)
 {
-  PyObject *ret;
+  PyObject *ret=0;
   if(dynamic_cast<ParaMEDMEM::MEDCouplingUMesh *>(mesh))
     ret=SWIG_NewPointerObj((void*)mesh,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,owner);
   if(dynamic_cast<ParaMEDMEM::MEDCouplingExtrudedMesh *>(mesh))
     ret=SWIG_NewPointerObj((void*)mesh,SWIGTYPE_p_ParaMEDMEM__MEDCouplingExtrudedMesh,owner);
+  if(dynamic_cast<ParaMEDMEM::MEDCouplingCMesh *>(mesh))
+    ret=SWIG_NewPointerObj((void*)mesh,SWIGTYPE_p_ParaMEDMEM__MEDCouplingCMesh,owner);
+  if(!ret)
+    {
+      PyErr_SetString(PyExc_TypeError,"Not recognized type of mesh on downcast !");
+      PyErr_Print();
+    }
   return ret;
 }