$(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
libVISUEngineImpl_la_LIBADD= \
-lboost_signals@BOOST_LIBSUFFIX@ \
-lboost_thread@BOOST_LIBSUFFIX@ \
- -lboost_filesystem@BOOST_LIBSUFFIX@ \
-lSalomeHDFPersist \
-lSalomeGenericObj \
-lSalomeContainer \
if(MYDEBUG) MESSAGE("VISU_Gen_i::Save - theURL = '"<<theURL<<"'");
Result_i::TFileNames aFileNames;
- Result_i::TFileNames aFullFileNames;
+ Result_i::TFileNames aFiles;
SALOMEDS::Study_var aStudy = theComponent->GetStudy();
SALOMEDS::ChildIterator_var anIter = aStudy->NewChildIterator(theComponent);
theURL,
theIsMultiFile,
aFileNames,
- aFullFileNames);
+ aFiles);
}
}
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();
}
#include <strstream>
-#include <boost/filesystem/path.hpp>
-#include <boost/filesystem/operations.hpp>
-namespace filesystem = boost::filesystem;
-
#ifdef _DEBUG_
static int MYDEBUG = 1;
static int MYTIMEDEBUG = 0;
const std::string& theURL,
bool theIsMultiFile,
TFileNames& theFileNames,
- TFileNames& theFullFileNames)
+ TFileNames& theFiles)
{
INITMSG(MYDEBUG, "MultiResult_i::Save - this = "<<this<<"\n");
theURL,
theIsMultiFile,
theFileNames,
- theFullFileNames);
+ theFiles);
if(!anIsDone)
return false;
MultiResult_i::TPartInfo aPartInfo = GetPartInfo(myMultiprObj, aPartName);
QFileInfo aFileInfo(aPartInfo.myFileName.c_str());
- theFullFileNames.push_back(aFileInfo.absFilePath());
+ std::string aFile = aFileInfo.absFilePath().latin1();
std::string aFileName = aFileInfo.fileName().latin1();
VISU::TSubString(aFileName, aFilePrefix) = aPrefix;
VISU::TSubString(aFileName, aSuffix) = "";
aFileName = aFileName + aSuffix;
INITMSG(MYDEBUG, "aFileName = '"<<aFileName<<"'\n");
- theFileNames.push_back(aFileName);
+
+ if(theIsMultiFile){
+ std::string aPathToCopy(theURL + aFileName);
+ BEGMSG(MYDEBUG, "aPathToCopy = '"<<aPathToCopy<<"'\n");
+ if(!VISU::CopyFile(aFile, aPathToCopy))
+ return false;
+ }
+
+ if(!theIsMultiFile)
+ theFileNames.push_back(aFileName);
+
+ theFiles.push_back(aFile);
}
return true;
QFileInfo aFileInfo(aPartInfo.myFileName.c_str());
std::string aFileName = aFileInfo.fileName().latin1();
VISU::TSubString(aFileName, aFilePrefix + "_") = "";
+ VISU::TSubString(aFileName, aSuffix) = "";
aPartInfo.myFileName = aFileName + aSuffix;
aPartInfos<<aPartInfo<<"|";
#include <boost/thread/thread.hpp>
#include <boost/bind.hpp>
-#include <boost/filesystem/path.hpp>
-#include <boost/filesystem/operations.hpp>
-namespace filesystem = boost::filesystem;
-
#ifdef _DEBUG_
static int MYTIMEDEBUG = 0;
#else
}
+ //----------------------------------------------------------------------------
+ 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;
+ }
+
+
//----------------------------------------------------------------------------
}
bool theRemoveEmptyDir = true);
//----------------------------------------------------------------------------
+ bool
+ CopyFile(const std::string& theSourceFileName,
+ const std::string& theTargetFileName);
+
+ //----------------------------------------------------------------------------
}
// OCCT Includes
#include <Bnd_Box.hxx>
-#include <boost/filesystem/path.hpp>
-#include <boost/filesystem/operations.hpp>
-namespace filesystem = boost::filesystem;
-
-
#ifdef _DEBUG_
static int MYDEBUG = 1;
#else
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 = "<<this<<"\n");
+
std::string aPrefix;
if (theIsMultiFile) {
CORBA::String_var anURL = GetStudyDocument()->URL();
}
std::string aFileName = aPrefix + "_" + GetName();
- std::string aFilePath = GetFileInfo().filePath().latin1();
+ BEGMSG(MYDEBUG, "aFileName = '"<<aFileName<<"'\n");
- if(theIsMultiFile){
- CORBA::String_var anURL = GetStudyDocument()->URL();
- aFilePath = SALOMEDS_Tool::GetNameFromPath(anURL.in()) + aFilePath;
+ std::string aFile = GetFileInfo().filePath().latin1();
+ BEGMSG(MYDEBUG, "aFile = '"<<aFile<<"'\n");
- filesystem::path aPathToCopy = filesystem::path(theURL) / aFileName;
- filesystem::copy_file(aFilePath, aPathToCopy);
- if(!filesystem::exists(aPathToCopy))
+ if(theIsMultiFile){
+ std::string aPathToCopy(theURL + aFileName);
+ BEGMSG(MYDEBUG, "aPathToCopy = '"<<aPathToCopy<<"'\n");
+ if(!VISU::CopyFile(aFile, aPathToCopy))
return false;
}
- if(MYDEBUG){
- MESSAGE("Result_i::Save - aFileName ='"<<aFileName<<"'");
- MESSAGE("Result_i::Save - aFilePath ='"<<aFileName<<"'");
- }
+ if(!theIsMultiFile)
+ theFileNames.push_back(aFileName);
- theFileNames.push_back(aFileName);
- theFullFileNames.push_back(aFilePath);
+ theFiles.push_back(aFile);
return true;
}}