From 4ab992a784b4a30e7ac59c46d72214036b27f1d1 Mon Sep 17 00:00:00 2001 From: eap Date: Tue, 19 Feb 2008 08:30:03 +0000 Subject: [PATCH] PAL18313 4.x Mandriva 64 porting: CRASH after trying to create presentation after "Import Structure" applying. fix defining VTK type for int field --- src/VISU_I/VISU_CorbaMedConvertor.cxx | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) 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) -- 2.39.2