From 93f207e460acb0c5aa153a22eea12cf479d00355 Mon Sep 17 00:00:00 2001 From: abd Date: Mon, 28 Apr 2008 06:23:14 +0000 Subject: [PATCH] Correction compilation on Linux --- src/CONVERTOR/Makefile.am | 1 + src/CONVERTOR/VISU_MedConvertor.cxx | 5 +++-- src/PIPELINE/Makefile.am | 1 + src/VISU_I/VISU_CorbaMedConvertor.cxx | 25 +++++++++++++++++++++---- 4 files changed, 26 insertions(+), 6 deletions(-) diff --git a/src/CONVERTOR/Makefile.am b/src/CONVERTOR/Makefile.am index f0782c7c..9bfefbf3 100644 --- a/src/CONVERTOR/Makefile.am +++ b/src/CONVERTOR/Makefile.am @@ -84,6 +84,7 @@ libVisuConvertor_la_CPPFLAGS= \ libVisuConvertor_la_LDFLAGS= \ + $(MED2_LIBS) \ $(VTK_LIBS) \ $(QT_LIBS) \ $(CAS_KERNEL) \ diff --git a/src/CONVERTOR/VISU_MedConvertor.cxx b/src/CONVERTOR/VISU_MedConvertor.cxx index 090c727f..8e02d8e8 100644 --- a/src/CONVERTOR/VISU_MedConvertor.cxx +++ b/src/CONVERTOR/VISU_MedConvertor.cxx @@ -24,6 +24,7 @@ // Author : Alexey PETROV // Module : VISU +using namespace std; #include "VISU_MedConvertor.hxx" #include "VISU_ConvertorUtils.hxx" @@ -1370,7 +1371,7 @@ namespace VISU //--------------------------------------------------------------- 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); @@ -1378,7 +1379,7 @@ CreateConvertor(const string& theFileName) } 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), diff --git a/src/PIPELINE/Makefile.am b/src/PIPELINE/Makefile.am index bb169513..51adaa9a 100644 --- a/src/PIPELINE/Makefile.am +++ b/src/PIPELINE/Makefile.am @@ -106,6 +106,7 @@ libVisuPipeLine_la_CPPFLAGS= \ -I$(srcdir)/../CONVERTOR libVisuPipeLine_la_LDFLAGS= \ + $(MED2_LIBS) \ $(VTK_LIBS) -lVTKViewer \ $(KERNEL_LDFLAGS) -lSALOMELocalTrace \ $(GUI_LDFLAGS) \ 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