From: apo Date: Thu, 12 Jul 2007 09:47:09 +0000 (+0000) Subject: Implementation of muti-save mode support for usual mode persistent (non-ASCII) X-Git-Tag: T_MULTIPR_INDUS_Persistence~10 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b1fa34762c293cb9df4fcb6353b442a71bc35ed3;p=modules%2Fvisu.git Implementation of muti-save mode support for usual mode persistent (non-ASCII) --- diff --git a/src/VISU_I/Makefile.am b/src/VISU_I/Makefile.am index 9bc96abd..7b370157 100644 --- a/src/VISU_I/Makefile.am +++ b/src/VISU_I/Makefile.am @@ -101,7 +101,11 @@ libVISUEngineImpl_la_CPPFLAGS= \ $(MED_CXXFLAGS) \ $(GUI_CXXFLAGS) \ $(CORBA_CXXFLAGS) $(CORBA_INCLUDES) \ - -I$(srcdir)/../CONVERTOR -I$(srcdir)/../PIPELINE -I$(srcdir)/../OBJECT -I$(srcdir)/../VVTK -I$(srcdir)/../GUITOOLS \ + -I$(srcdir)/../CONVERTOR \ + -I$(srcdir)/../PIPELINE \ + -I$(srcdir)/../OBJECT \ + -I$(srcdir)/../VVTK \ + -I$(srcdir)/../GUITOOLS \ -I$(top_builddir)/idl \ -I$(top_builddir)/salome_adm/unix @@ -119,7 +123,6 @@ libVISUEngineImpl_la_LDFLAGS= \ libVISUEngineImpl_la_LIBADD= \ -lboost_signals@BOOST_LIBSUFFIX@ \ -lboost_thread@BOOST_LIBSUFFIX@ \ - -lboost_filesystem@BOOST_LIBSUFFIX@ \ -lSalomeHDFPersist \ -lSalomeGenericObj \ -lSalomeContainer \ diff --git a/src/VISU_I/VISU_Gen_i.cc b/src/VISU_I/VISU_Gen_i.cc index 249561fe..73545389 100644 --- a/src/VISU_I/VISU_Gen_i.cc +++ b/src/VISU_I/VISU_Gen_i.cc @@ -369,7 +369,7 @@ namespace VISU if(MYDEBUG) MESSAGE("VISU_Gen_i::Save - theURL = '"<GetStudy(); SALOMEDS::ChildIterator_var anIter = aStudy->NewChildIterator(theComponent); @@ -381,7 +381,7 @@ namespace VISU theURL, theIsMultiFile, aFileNames, - aFullFileNames); + aFiles); } } @@ -394,18 +394,18 @@ namespace VISU aListOfFileNames[aCounter-1] = aFileNames[aCounter-1].c_str(); } - SALOMEDS::ListOfFileNames_var aListOfFullFileNames = new SALOMEDS::ListOfFileNames; - if(!aFullFileNames.empty()){ - aListOfFullFileNames->length(aFullFileNames.size()); - for(int aCounter = aFullFileNames.size(); aCounter > 0; aCounter--) - aListOfFullFileNames[aCounter-1] = aFullFileNames[aCounter-1].c_str(); + SALOMEDS::ListOfFileNames_var aListOfFiles = new SALOMEDS::ListOfFileNames; + if(!aFiles.empty()){ + aListOfFiles->length(aFiles.size()); + for(int aCounter = aFiles.size(); aCounter > 0; aCounter--) + aListOfFiles[aCounter-1] = aFiles[aCounter-1].c_str(); } SALOMEDS::TMPFile_var aStreamFile = new SALOMEDS::TMPFile(0); if(theIsMultiFile) - aStreamFile = SALOMEDS_Tool::PutFilesToStream(theURL, aListOfFullFileNames.in(), theIsMultiFile); + aStreamFile = SALOMEDS_Tool::PutFilesToStream(theURL, aListOfFiles.in(), theIsMultiFile); else - aStreamFile = SALOMEDS_Tool::PutFilesToStream(aListOfFullFileNames.in(), aListOfFileNames.in()); + aStreamFile = SALOMEDS_Tool::PutFilesToStream(aListOfFiles.in(), aListOfFileNames.in()); return aStreamFile._retn(); } diff --git a/src/VISU_I/VISU_MultiResult_i.cc b/src/VISU_I/VISU_MultiResult_i.cc index d114f15b..7c094e26 100644 --- a/src/VISU_I/VISU_MultiResult_i.cc +++ b/src/VISU_I/VISU_MultiResult_i.cc @@ -41,10 +41,6 @@ #include -#include -#include -namespace filesystem = boost::filesystem; - #ifdef _DEBUG_ static int MYDEBUG = 1; static int MYTIMEDEBUG = 0; @@ -583,7 +579,7 @@ VISU::MultiResult_i const std::string& theURL, bool theIsMultiFile, TFileNames& theFileNames, - TFileNames& theFullFileNames) + TFileNames& theFiles) { INITMSG(MYDEBUG, "MultiResult_i::Save - this = "< #include -#include -#include -namespace filesystem = boost::filesystem; - #ifdef _DEBUG_ static int MYTIMEDEBUG = 0; #else @@ -641,5 +637,22 @@ namespace VISU } + //---------------------------------------------------------------------------- + bool + CopyFile(const std::string& theSourceFileName, + const std::string& theTargetFileName) + { + QFileInfo aSourceFileInfo(theSourceFileName); + QFileInfo aTargetFileInfo(theTargetFileName); + QString aCommand; + aCommand.sprintf("%s %s %s", + COPY_COMMAND, + aSourceFileInfo.filePath().latin1(), + aTargetFileInfo.filePath().latin1()); + + return system(aCommand.latin1()) == 0; + } + + //---------------------------------------------------------------------------- } diff --git a/src/VISU_I/VISU_ResultUtils.hh b/src/VISU_I/VISU_ResultUtils.hh index 335849f1..f6807a7b 100644 --- a/src/VISU_I/VISU_ResultUtils.hh +++ b/src/VISU_I/VISU_ResultUtils.hh @@ -139,6 +139,11 @@ namespace VISU bool theRemoveEmptyDir = true); //---------------------------------------------------------------------------- + bool + CopyFile(const std::string& theSourceFileName, + const std::string& theTargetFileName); + + //---------------------------------------------------------------------------- } diff --git a/src/VISU_I/VISU_Result_i.cc b/src/VISU_I/VISU_Result_i.cc index f07256d4..951a5b52 100644 --- a/src/VISU_I/VISU_Result_i.cc +++ b/src/VISU_I/VISU_Result_i.cc @@ -60,11 +60,6 @@ // OCCT Includes #include -#include -#include -namespace filesystem = boost::filesystem; - - #ifdef _DEBUG_ static int MYDEBUG = 1; #else @@ -606,11 +601,13 @@ VISU::Result_i const std::string& theURL, bool theIsMultiFile, TFileNames& theFileNames, - TFileNames& theFullFileNames) + TFileNames& theFiles) { switch(GetCreationId()){ case Result_i::eImportFile: case Result_i::eCopyAndImportFile: { + INITMSG(MYDEBUG, "Result::Save - this = "<URL(); @@ -618,25 +615,22 @@ VISU::Result_i } std::string aFileName = aPrefix + "_" + GetName(); - std::string aFilePath = GetFileInfo().filePath().latin1(); + BEGMSG(MYDEBUG, "aFileName = '"<URL(); - aFilePath = SALOMEDS_Tool::GetNameFromPath(anURL.in()) + aFilePath; + std::string aFile = GetFileInfo().filePath().latin1(); + BEGMSG(MYDEBUG, "aFile = '"<