// Author : Alexey PETROV
// Module : VISU
+using namespace std;
#include "VISU_MedConvertor.hxx"
#include "VISU_ConvertorUtils.hxx"
//---------------------------------------------------------------
extern "C"
VISU_Convertor*
-CreateConvertor(const string& theFileName)
+CreateConvertor(const std::string& theFileName)
{
if(MED::PWrapper aMed = MED::CrWrapper(theFileName,true))
return new VISU_MedConvertor(theFileName, aMed);
}
VISU_MedConvertor
-::VISU_MedConvertor(const string& theFileName, MED::PWrapper theMed):
+::VISU_MedConvertor(const std::string& theFileName, MED::PWrapper theMed):
myIsEntitiesDone(false),
myIsFieldsDone(false),
myIsGroupsDone(false),
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)