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 = "<<aMeshName<<"; myDim = "<<aMesh->myDim);
vtkIdType aDataType = VTK_DOUBLE;
SALOME_MED::FIELDDOUBLE_ptr aFieldDouble = SALOME_MED::FIELDDOUBLE::_narrow(aMEDField);
- 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 {
+ MESSAGE("Can't map CORBA::Long to a VTK type, for Field " << aFieldName);
+ continue;
+ }
+ }
aField->Init(aMEDField->getNumberOfComponents(), aDataType);
if(MYDEBUG)