From: eap Date: Tue, 19 Feb 2008 08:30:03 +0000 (+0000) Subject: PAL18313 4.x Mandriva 64 porting: CRASH after trying to create presentation after... X-Git-Tag: V4_1_1~4 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=4ab992a784b4a30e7ac59c46d72214036b27f1d1;p=modules%2Fvisu.git PAL18313 4.x Mandriva 64 porting: CRASH after trying to create presentation after "Import Structure" applying. fix defining VTK type for int field --- diff --git a/src/VISU_I/VISU_CorbaMedConvertor.cxx b/src/VISU_I/VISU_CorbaMedConvertor.cxx index 11427b1a..aea4b36c 100644 --- a/src/VISU_I/VISU_CorbaMedConvertor.cxx +++ b/src/VISU_I/VISU_CorbaMedConvertor.cxx @@ -673,8 +673,16 @@ VISU_MEDFieldConvertor vtkIdType aDataType = VTK_DOUBLE; SALOME_MED::FIELDDOUBLE_ptr aFieldDouble = SALOME_MED::FIELDDOUBLE::_narrow(myField); - if(aFieldDouble->_is_nil()) - aDataType = VTK_LONG; + if(aFieldDouble->_is_nil()) { + // PAL18313: Mandriva 64 porting: CRASH at creating presentation on "Import Structure". + if (sizeof(long) == 4 ) // Size of CORBA::Long is always 4 (see CORBA_basetypes.h) + aDataType = VTK_LONG; + else if (sizeof(int) == 4) + aDataType = VTK_INT; + else { + throw std::runtime_error("Can't map CORBA::Long to a VTK type"); + } + } aField->Init(myField->getNumberOfComponents(), aDataType); if(MYDEBUG) MESSAGE("VISU_MEDFieldConvertor::Build - aMeshName = "<Init(aMEDField->getNumberOfComponents(), aDataType); if(MYDEBUG)