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()) {
+ if (sizeof(long) == 4 ) // Size of CORBA::Long is always 4 (see CORBA_basetypes.h)
+ //Fix for IPAL20325 Crash on create presentation for imported field
+ 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(aMEDField->getNumberOfComponents(), aDataType);
-
aFieldMap[aFieldName.in()] = aField;
if(MYDEBUG)