From 5d1aab478802c8c0680f1c3e028de6f449780c56 Mon Sep 17 00:00:00 2001 From: apo Date: Mon, 2 Jul 2007 12:37:39 +0000 Subject: [PATCH] To customize persistent functionality --- src/VISU_I/VISUConfig.cc | 107 ++++--- src/VISU_I/VISUConfig.hh | 64 ++-- src/VISU_I/VISU_ColoredPrs3dCache_i.cc | 14 +- src/VISU_I/VISU_ColoredPrs3dCache_i.hh | 10 +- src/VISU_I/VISU_ColoredPrs3dHolder_i.cc | 7 +- src/VISU_I/VISU_ColoredPrs3dHolder_i.hh | 7 +- src/VISU_I/VISU_ColoredPrs3d_i.hh | 7 +- src/VISU_I/VISU_Gen_i.cc | 370 +++++++++--------------- src/VISU_I/VISU_Mesh_i.cc | 7 +- src/VISU_I/VISU_Mesh_i.hh | 7 +- src/VISU_I/VISU_MultiResult_i.cc | 5 +- src/VISU_I/VISU_MultiResult_i.hh | 11 +- src/VISU_I/VISU_Result_i.cc | 141 ++++++++- src/VISU_I/VISU_Result_i.hh | 39 ++- src/VISU_I/VISU_Table_i.cc | 18 +- src/VISU_I/VISU_Table_i.hh | 21 +- 16 files changed, 480 insertions(+), 355 deletions(-) diff --git a/src/VISU_I/VISUConfig.cc b/src/VISU_I/VISUConfig.cc index bcde9828..03eb5709 100644 --- a/src/VISU_I/VISUConfig.cc +++ b/src/VISU_I/VISUConfig.cc @@ -39,7 +39,7 @@ #include -using namespace std; +#include #ifdef _DEBUG_ static int MYDEBUG = 0; @@ -47,7 +47,9 @@ static int MYDEBUG = 0; static int MYDEBUG = 0; #endif -namespace VISU{ + +namespace VISU +{ SUIT_Session* GetSession() @@ -103,7 +105,7 @@ namespace VISU{ //--------------------------------------------------------------------------- - static Storable::TCallbackMap VisuStoreMap; + Storable::TStorableEngineMap Storable::myStorableEngineMap; std::string Storable @@ -118,16 +120,74 @@ namespace VISU{ } + //--------------------------------------------------------------- + CORBA::Boolean + Storable + ::CanCopy(SALOMEDS::SObject_ptr theObject) + { + return false; + } + + + //--------------------------------------------------------------- + bool + Storable + ::CopyFrom(SALOMEDS::SObject_ptr theObject, + CORBA::Long& theObjectID, + const std::string& theTmpDir, + TFileNames& theFileNames) + { + TFileName aFileName("copy_persistent"); + std::string aCopyPersist = theTmpDir + aFileName; + std::ofstream anOutputFileStream(aCopyPersist.c_str(), ios::out); + anOutputFileStream<> dupliacte registring !!!"); + if(!myStorableEngineMap.insert(TStorableEngineMap::value_type(theComment, theEngine)).second) throw std::logic_error("Storable::Registry >> dupliacte registring !!!"); + } + + + //--------------------------------------------------------------- + Storable* + Storable + ::Create(SALOMEDS::SObject_ptr theSObject, + const std::string& theLocalPersistentID, + const std::string& thePrefix, + CORBA::Boolean theIsMultiFile) + { + try{ + QString aString( CorrectPersistentString( theLocalPersistentID ) ); + TRestoringMap aRestoringMap; + StringToMap(aString, aRestoringMap); + bool anIsExists; + QString aComment = VISU::Storable::FindValue(aRestoringMap, "myComment", &anIsExists); + if ( anIsExists ) { + TStorableEngineMap::const_iterator anIter = myStorableEngineMap.find(aComment.latin1()); + if(MYDEBUG) MESSAGE("Storable::Create - "<second; + return aStorableEngine(theSObject, aRestoringMap, thePrefix, theIsMultiFile); + } + }catch(std::exception& exc){ + INFOS("Follow exception was occured :\n"<second; - return aStorableEngine(theSObject, thePrefix, aRestoringMap); - } - }catch(std::exception& exc){ - INFOS("Follow exception was occured :\n"<reference_to_servant(theObject); diff --git a/src/VISU_I/VISUConfig.hh b/src/VISU_I/VISUConfig.hh index 58206b2a..f83ec1c0 100644 --- a/src/VISU_I/VISUConfig.hh +++ b/src/VISU_I/VISUConfig.hh @@ -119,8 +119,6 @@ namespace VISU //=========================================================================== class VISU_I_EXPORT Storable : public virtual Base_i { - protected: - virtual void ToStream(std::ostringstream& theStr) = 0; public: std::string ToString(); @@ -129,13 +127,31 @@ namespace VISU const char* GetComment() const = 0; + + //--------------------------------------------------------------- typedef std::map TRestoringMap; typedef Storable* (*TStorableEngine)(SALOMEDS::SObject_ptr theSObject, + const TRestoringMap& theMap, const std::string& thePrefix, - const TRestoringMap& theMap); - typedef std::map TCallbackMap; + CORBA::Boolean theIsMultiFile); + + typedef std::map TStorableEngineMap; + static + void + RegistryStorableEngine(const std::string& theComment, + TStorableEngine theEngine); + + static + Storable* + Create(SALOMEDS::SObject_ptr theSObject, + const std::string& theLocalPersistentID, + const std::string& thePrefix, + CORBA::Boolean theIsMultiFile); + + + //--------------------------------------------------------------- static VISU::VISUType Comment2Type(const std::string& theComment); @@ -163,17 +179,6 @@ namespace VISU const TRestoringMap& theRestoringMap, int IsAllLevels = true); - static - void - Registry(const std::string& theComment, - TStorableEngine theEngine); - - static - Storable* - Create(SALOMEDS::SObject_ptr, - const std::string& thePrefix, - const std::string& theString); - static QString FindValue(const TRestoringMap& theMap, @@ -216,13 +221,34 @@ namespace VISU DataToStream(std::ostringstream& theStr, const QString& theName, const double theVal); + + //--------------------------------------------------------------- + virtual + CORBA::Boolean + CanCopy(SALOMEDS::SObject_ptr theObject); + + typedef std::string TFileName; + typedef std::vector TFileNames; + + virtual + bool + CopyFrom(SALOMEDS::SObject_ptr theObject, + CORBA::Long& theObjectID, + const std::string& theTmpDir, + TFileNames& theFileNames); + + + //--------------------------------------------------------------- + protected: + virtual + void + ToStream(std::ostringstream& theStr) = 0; + + private: + static TStorableEngineMap myStorableEngineMap; }; //=========================================================================== - VISU_I_EXPORT - const CORBA::Boolean - IsMultifile(); - VISU_I_EXPORT QString GenerateName(const std::string& theFmt, int theId); diff --git a/src/VISU_I/VISU_ColoredPrs3dCache_i.cc b/src/VISU_I/VISU_ColoredPrs3dCache_i.cc index 2485fe3b..595fd30a 100644 --- a/src/VISU_I/VISU_ColoredPrs3dCache_i.cc +++ b/src/VISU_I/VISU_ColoredPrs3dCache_i.cc @@ -806,23 +806,23 @@ VISU::ColoredPrs3dCache_i VISU::Storable* VISU::ColoredPrs3dCache_i ::Restore(SALOMEDS::SObject_ptr theSObject, - const Storable::TRestoringMap& theMap, - const string& thePrefix) + const Storable::TRestoringMap& theMap) { SetMemoryMode( (VISU::ColoredPrs3dCache::MemoryMode)VISU::Storable::FindValue( theMap, "myMemoryMode" ).toInt() ); SetLimitedMemory( VISU::Storable::FindValue( theMap, "myLimitedMemory" ).toInt() ); - + return this; } //--------------------------------------------------------------- VISU::Storable* VISU::ColoredPrs3dCache_i -::Restore(SALOMEDS::SObject_ptr theSObject, - const string& thePrefix, - const Storable::TRestoringMap& theMap) +::StorableEngine(SALOMEDS::SObject_ptr theSObject, + const Storable::TRestoringMap& theMap, + const std::string& thePrefix, + CORBA::Boolean theIsMultiFile) { SALOMEDS::Study_var aStudy = theSObject->GetStudy(); VISU::ColoredPrs3dCache_i* aCache = new VISU::ColoredPrs3dCache_i(aStudy, false); - return aCache->Restore(theSObject,theMap,thePrefix); + return aCache->Restore(theSObject, theMap); } diff --git a/src/VISU_I/VISU_ColoredPrs3dCache_i.hh b/src/VISU_I/VISU_ColoredPrs3dCache_i.hh index 56ab4a22..ead20807 100644 --- a/src/VISU_I/VISU_ColoredPrs3dCache_i.hh +++ b/src/VISU_I/VISU_ColoredPrs3dCache_i.hh @@ -189,14 +189,14 @@ namespace VISU virtual Storable* Restore(SALOMEDS::SObject_ptr theSObject, - const Storable::TRestoringMap& theMap, - const std::string& thePrefix); + const Storable::TRestoringMap& theMap); static Storable* - Restore(SALOMEDS::SObject_ptr theSObject, - const std::string& thePrefix, - const Storable::TRestoringMap& theMap); + StorableEngine(SALOMEDS::SObject_ptr theSObject, + const Storable::TRestoringMap& theMap, + const std::string& thePrefix, + CORBA::Boolean theIsMultiFile); //---------------------------------------------------------------------------- //! Finds or creates instance of the ColoredPrs3dCache in the given SALOMEDS::Study diff --git a/src/VISU_I/VISU_ColoredPrs3dHolder_i.cc b/src/VISU_I/VISU_ColoredPrs3dHolder_i.cc index 1adcba4d..9441e543 100644 --- a/src/VISU_I/VISU_ColoredPrs3dHolder_i.cc +++ b/src/VISU_I/VISU_ColoredPrs3dHolder_i.cc @@ -240,9 +240,10 @@ VISU::ColoredPrs3dHolder_i //--------------------------------------------------------------- VISU::Storable* VISU::ColoredPrs3dHolder_i -::Restore(SALOMEDS::SObject_ptr theSObject, - const string& thePrefix, - const Storable::TRestoringMap& theMap) +::StorableEngine(SALOMEDS::SObject_ptr theSObject, + const Storable::TRestoringMap& theMap, + const std::string& thePrefix, + CORBA::Boolean theIsMultiFile) { using namespace VISU; SALOMEDS::Study_var aStudy = theSObject->GetStudy(); diff --git a/src/VISU_I/VISU_ColoredPrs3dHolder_i.hh b/src/VISU_I/VISU_ColoredPrs3dHolder_i.hh index bdf2c2da..840d537e 100644 --- a/src/VISU_I/VISU_ColoredPrs3dHolder_i.hh +++ b/src/VISU_I/VISU_ColoredPrs3dHolder_i.hh @@ -125,9 +125,10 @@ namespace VISU static Storable* - Restore(SALOMEDS::SObject_ptr theSObject, - const std::string& thePrefix, - const Storable::TRestoringMap& theMap); + StorableEngine(SALOMEDS::SObject_ptr theSObject, + const Storable::TRestoringMap& theMap, + const std::string& thePrefix, + CORBA::Boolean theIsMultiFile); virtual QString diff --git a/src/VISU_I/VISU_ColoredPrs3d_i.hh b/src/VISU_I/VISU_ColoredPrs3d_i.hh index 3a5d0202..d1e64283 100644 --- a/src/VISU_I/VISU_ColoredPrs3d_i.hh +++ b/src/VISU_I/VISU_ColoredPrs3d_i.hh @@ -513,9 +513,10 @@ namespace VISU //---------------------------------------------------------------------------- template Storable* - Restore(SALOMEDS::SObject_ptr theSObject, - const std::string& thePrefix, - const Storable::TRestoringMap& theMap) + StorableEngine(SALOMEDS::SObject_ptr theSObject, + const Storable::TRestoringMap& theMap, + const std::string& thePrefix, + CORBA::Boolean theIsMultiFile) { TColoredPrs3d* aColoredPrs3d = new TColoredPrs3d(ColoredPrs3d_i::EDoNotPublish); return aColoredPrs3d->Restore(theSObject, theMap); diff --git a/src/VISU_I/VISU_Gen_i.cc b/src/VISU_I/VISU_Gen_i.cc index fe61c34f..c364188f 100644 --- a/src/VISU_I/VISU_Gen_i.cc +++ b/src/VISU_I/VISU_Gen_i.cc @@ -111,7 +111,10 @@ namespace VISU static std::string VISU_TMP_DIR; static CORBA::Boolean myIsMultiFile; - const CORBA::Boolean IsMultifile() { return myIsMultiFile;} + const CORBA::Boolean IsMultiFile() + { + return myIsMultiFile; + } //---------------------------------------------------------------------------- _PTR(SComponent) @@ -192,23 +195,27 @@ namespace VISU void RegistryStorable() { - Storable::Registry(Result_i::myComment.c_str(),&(Result_i::Restore)); - Storable::Registry(Mesh_i::myComment.c_str(),&(Mesh_i::Restore)); - Storable::Registry(ScalarMap_i::myComment.c_str(),&(Restore)); - Storable::Registry(GaussPoints_i::myComment.c_str(),&(Restore)); - Storable::Registry(DeformedShape_i::myComment.c_str(),&(Restore)); - Storable::Registry(CutPlanes_i::myComment.c_str(),&(Restore)); - Storable::Registry(CutLines_i::myComment.c_str(),&(Restore)); - Storable::Registry(IsoSurfaces_i::myComment.c_str(),&(Restore)); - Storable::Registry(StreamLines_i::myComment.c_str(),&(Restore)); - Storable::Registry(Plot3D_i::myComment.c_str(),&(Restore)); - Storable::Registry(Vectors_i::myComment.c_str(),&(Restore)); - Storable::Registry(Table_i::myComment.c_str(),&(Table_i::Restore)); - Storable::Registry(Curve_i::myComment.c_str(),&(Curve_i::Restore)); - Storable::Registry(Container_i::myComment.c_str(),&(Container_i::Restore)); - Storable::Registry(ScalarMapOnDeformedShape_i::myComment.c_str(),&(Restore)); - Storable::Registry(ColoredPrs3dHolder_i::myComment.c_str(),&(ColoredPrs3dHolder_i::Restore)); - Storable::Registry(ColoredPrs3dCache_i::myComment.c_str(),&(ColoredPrs3dCache_i::Restore)); + Storable::RegistryStorableEngine(Result_i::myComment.c_str(),&(Result_i::StorableEngine)); + + Storable::RegistryStorableEngine(Mesh_i::myComment.c_str(),&(Mesh_i::StorableEngine)); + + Storable::RegistryStorableEngine(ScalarMap_i::myComment.c_str(),&(StorableEngine)); + Storable::RegistryStorableEngine(GaussPoints_i::myComment.c_str(),&(StorableEngine)); + Storable::RegistryStorableEngine(DeformedShape_i::myComment.c_str(),&(StorableEngine)); + Storable::RegistryStorableEngine(CutPlanes_i::myComment.c_str(),&(StorableEngine)); + Storable::RegistryStorableEngine(CutLines_i::myComment.c_str(),&(StorableEngine)); + Storable::RegistryStorableEngine(IsoSurfaces_i::myComment.c_str(),&(StorableEngine)); + Storable::RegistryStorableEngine(StreamLines_i::myComment.c_str(),&(StorableEngine)); + Storable::RegistryStorableEngine(Plot3D_i::myComment.c_str(),&(StorableEngine)); + Storable::RegistryStorableEngine(Vectors_i::myComment.c_str(),&(StorableEngine)); + Storable::RegistryStorableEngine(ScalarMapOnDeformedShape_i::myComment.c_str(),&(StorableEngine)); + + Storable::RegistryStorableEngine(ColoredPrs3dHolder_i::myComment.c_str(),&(ColoredPrs3dHolder_i::StorableEngine)); + Storable::RegistryStorableEngine(ColoredPrs3dCache_i::myComment.c_str(),&(ColoredPrs3dCache_i::StorableEngine)); + + Storable::RegistryStorableEngine(Table_i::myComment.c_str(),&(Table_i::StorableEngine)); + Storable::RegistryStorableEngine(Curve_i::myComment.c_str(),&(Curve_i::StorableEngine)); + Storable::RegistryStorableEngine(Container_i::myComment.c_str(),&(Container_i::StorableEngine)); } @@ -296,7 +303,7 @@ namespace VISU ::Load(SALOMEDS::SComponent_ptr theComponent, const SALOMEDS::TMPFile & theStream, const char* theURL, - bool theIsMultiFile) + CORBA::Boolean theIsMultiFile) { Mutex mt(myMutex); SALOMEDS::Study_var aStudy = theComponent->GetStudy(); @@ -334,15 +341,16 @@ namespace VISU char* VISU_Gen_i ::LocalPersistentIDToIOR(SALOMEDS::SObject_ptr theSObject, - const char* aLocalPersistentID, + const char* theLocalPersistentID, CORBA::Boolean theIsMultiFile, CORBA::Boolean theIsASCII) { CORBA::String_var aString(""); - if(strcmp(aLocalPersistentID,"") != 0) { - Mutex mt(myMutex); - Storable* aStorable = - Storable::Create(theSObject, VISU_TMP_DIR.c_str(), aLocalPersistentID); + if(strcmp(theLocalPersistentID,"") != 0) { + Storable* aStorable = Storable::Create(theSObject, + theLocalPersistentID, + VISU_TMP_DIR, + theIsMultiFile); if(aStorable != NULL) aString = aStorable->GetID(); } @@ -354,45 +362,26 @@ namespace VISU SALOMEDS::TMPFile* VISU_Gen_i ::Save(SALOMEDS::SComponent_ptr theComponent, - const char* theURL, + const char* theTmpDir, bool theIsMultiFile) { - Mutex mt(myMutex); - string aTmpDir = theURL; - if(MYDEBUG) MESSAGE("VISU_Gen_i::Save - "< TFileNames; TFileNames aFileNames; - TFileNames aFiles; + TFileNames aFilePathes; SALOMEDS::Study_var aStudy = theComponent->GetStudy(); SALOMEDS::ChildIterator_var anIter = aStudy->NewChildIterator(theComponent); for (; anIter->More(); anIter->Next()) { - SALOMEDS::SObject_var gotBranch = anIter->Value(); - CORBA::Object_var anObj = SObjectToObject(gotBranch); - if(CORBA::is_nil(anObj)) continue; + SALOMEDS::SObject_var aSObject = anIter->Value(); + CORBA::Object_var anObj = SObjectToObject(aSObject); if(Result_i* aResult = dynamic_cast(GetServant(anObj).in())){ - switch(aResult->GetCreationId()){ - case Result_i::eImportFile: - case Result_i::eCopyAndImportFile: { - const QFileInfo& aFileInfo = aResult->GetFileInfo(); - const std::string& aName = aResult->GetName(); - std::string aFileName = std::string("_") + aName; - std::string aFile = aFileInfo.filePath().latin1(); - if(theIsMultiFile){ - aFileName = SALOMEDS_Tool::GetNameFromPath(aStudy->URL()) + aFileName; - - std::ostringstream aStream; - aStream<<"cp "<Save(theComponent, theTmpDir, theIsMultiFile, aFileName, aFilePath)){ aFileNames.push_back(aFileName); - aFiles.push_back(aFile); - }} + aFilePathes.push_back(aFilePath); + } } } @@ -405,18 +394,18 @@ namespace VISU aListOfFileNames[aCounter-1] = aFileNames[aCounter-1].c_str(); } - SALOMEDS::ListOfFileNames_var aListOfFiles = new SALOMEDS::ListOfFileNames; - aListOfFiles->length(aFiles.size()); - if(!aFiles.empty()){ + SALOMEDS::ListOfFileNames_var aListOfFilePathes = new SALOMEDS::ListOfFileNames; + aListOfFilePathes->length(aFilePathes.size()); + if(!aFilePathes.empty()){ for(int aCounter = aFileNames.size(); aCounter > 0; aCounter--) - aListOfFiles[aCounter-1] = aFiles[aCounter-1].c_str(); + aListOfFilePathes[aCounter-1] = aFilePathes[aCounter-1].c_str(); } SALOMEDS::TMPFile_var aStreamFile = new SALOMEDS::TMPFile(0); if(theIsMultiFile) - aStreamFile = SALOMEDS_Tool::PutFilesToStream(aTmpDir, aListOfFiles.in(), theIsMultiFile); + aStreamFile = SALOMEDS_Tool::PutFilesToStream(theTmpDir, aListOfFilePathes.in(), theIsMultiFile); else - aStreamFile = SALOMEDS_Tool::PutFilesToStream(aListOfFiles.in(), aListOfFileNames.in()); + aStreamFile = SALOMEDS_Tool::PutFilesToStream(aListOfFilePathes.in(), aListOfFileNames.in()); return aStreamFile._retn(); } @@ -426,48 +415,26 @@ namespace VISU SALOMEDS::TMPFile* VISU_Gen_i ::SaveASCII(SALOMEDS::SComponent_ptr theComponent, - const char* theURL, + const char* theTmpDir, bool theIsMultiFile) { - Mutex mt(myMutex); - string aDir = theIsMultiFile ? theURL : SALOMEDS_Tool::GetTmpDir(); - TCollection_AsciiString aTmpDir (const_cast(aDir.c_str())); + std::string aTmpDir = theIsMultiFile ? theTmpDir : SALOMEDS_Tool::GetTmpDir(); if(MYDEBUG) MESSAGE("VISU_Gen_i::Save - "<GetStudy(); - SALOMEDS::ChildIterator_var itBig = aStudy->NewChildIterator(theComponent); - for (; itBig->More(); itBig->Next()) { - SALOMEDS::SObject_var gotBranch = itBig->Value(); + SALOMEDS::ChildIterator_var anIter = aStudy->NewChildIterator(theComponent); + for (; anIter->More(); anIter->Next()) { + SALOMEDS::SObject_var gotBranch = anIter->Value(); CORBA::Object_var anObj = SObjectToObject(gotBranch); - if(CORBA::is_nil(anObj)) continue; - if(Result_i* pResult = dynamic_cast(GetServant(anObj).in())){ - switch(pResult->GetCreationId()){ - case Result_i::eImportFile: - case Result_i::eCopyAndImportFile: { - const QFileInfo& aFileInfo = pResult->GetFileInfo(); - QString aPrefix(""); - if (theIsMultiFile) aPrefix = SALOMEDS_Tool::GetNameFromPath(aStudy->URL()).c_str(); - QString aFileName = aPrefix + "_" + (pResult->GetName()).c_str(); - QString tmpDir = QDir::convertSeparators( QString(aTmpDir.ToCString()) );; - static QString aCommand; - aCommand.sprintf(" %s %s%s",aFileInfo.filePath().latin1(),tmpDir.latin1(),aFileName.latin1()); - aCommand = QDir::convertSeparators( aCommand ); - aCommand.prepend( COPY_COMMAND ); - - if(system(aCommand.latin1())){ - if(MYDEBUG) MESSAGE("VISU_Gen_i::Save - Can't execute the command :"<(GetServant(anObj).in())){ + std::string aFileName; + if(aResult->SaveASCII(theComponent, aTmpDir, theIsMultiFile, aFileName)){ + TCollection_AsciiString aString(const_cast(aFileName.c_str())); aFileNames.Append(aString); - }} + } } } SALOMEDS::TMPFile_var aStreamFile = new SALOMEDS::TMPFile(0); @@ -477,9 +444,9 @@ namespace VISU aSeq->length(aFileNames.Length()); for(aCounter = aFileNames.Length(); aCounter > 0; aCounter--) aSeq[aCounter-1] = CORBA::string_dup(aFileNames.Value(aCounter).ToCString()); - aStreamFile = SALOMEDS_Tool::PutFilesToStream(aTmpDir.ToCString(), aSeq.in(), theIsMultiFile); + aStreamFile = SALOMEDS_Tool::PutFilesToStream(aTmpDir, aSeq.in(), theIsMultiFile); if(!theIsMultiFile) - SALOMEDS_Tool::RemoveTemporaryFiles(aTmpDir.ToCString(), aSeq.in(), true); + SALOMEDS_Tool::RemoveTemporaryFiles(aTmpDir, aSeq.in(), true); } return aStreamFile._retn(); } @@ -489,20 +456,16 @@ namespace VISU char* VISU_Gen_i ::IORToLocalPersistentID(SALOMEDS::SObject_ptr theSObject, - const char* IORString, + const char* theIORString, CORBA::Boolean theIsMultiFile, CORBA::Boolean theIsASCII) { - CORBA::String_var aString(IORString); - if(strcmp(IORString,"") != 0){ - CORBA::ORB_ptr anORB = GetORB(); - CORBA::Object_var anObj = anORB->string_to_object(aString); - if(!CORBA::is_nil(anObj)){ - if(Storable* pStorable = dynamic_cast(GetServant(anObj).in())){ - Mutex mt(myMutex); - aString = pStorable->ToString().c_str(); - return aString._retn(); - } + CORBA::String_var aString(""); + if(strcmp(theIORString, "") != 0){ + CORBA::Object_var anObj = GetORB()->string_to_object(theIORString); + if(Storable* aStorable = dynamic_cast(GetServant(anObj).in())){ + aString = aStorable->ToString().c_str(); + return aString._retn(); } } return aString._retn(); @@ -1256,32 +1219,10 @@ namespace VISU VISU_Gen_i ::CanCopy(SALOMEDS::SObject_ptr theObject) { - Mutex mt(myMutex); - SALOMEDS::GenericAttribute_var anAttr; - if (!theObject->FindAttribute(anAttr, "AttributeIOR")) return false; - try { - SALOMEDS::AttributeIOR_var anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr); - CORBA::String_var aValue = anIOR->Value(); - if(strcmp(aValue,"") != 0){ - CORBA::Object_ptr anObj = GetORB()->string_to_object(aValue); - if (!CORBA::is_nil(anObj)){ - Result_var aResultObj = Result::_narrow(anObj); - if(!aResultObj->_is_nil()){ - if(Result_i* pResult = dynamic_cast(GetServant(aResultObj).in())){ - switch(pResult->GetCreationId()){ - case Result_i::eImportFile: - case Result_i::eCopyAndImportFile: - return true; - } - } - } - } - } - }catch(std::exception& exc){ - INFOS("Follow exception was occured :\n"<(GetServant(anObj).in())) + return aStorable->CanCopy(theObject); + return false; } @@ -1289,72 +1230,31 @@ namespace VISU //--------------------------------------------------------------- SALOMEDS::TMPFile* VISU_Gen_i - ::CopyFrom(SALOMEDS::SObject_ptr theObject, CORBA::Long& theObjectID) + ::CopyFrom(SALOMEDS::SObject_ptr theObject, + CORBA::Long& theObjectID) { - Mutex mt(myMutex); theObjectID = 0; SALOMEDS::TMPFile_var aStreamFile = new SALOMEDS::TMPFile; - SALOMEDS::ListOfFileNames_var aSeq = new SALOMEDS::ListOfFileNames; - SALOMEDS::GenericAttribute_var anAttr; - if (!theObject->FindAttribute(anAttr,"AttributeIOR")) - return NULL; - SALOMEDS::AttributeIOR_var anIORAttr = SALOMEDS::AttributeIOR::_narrow(anAttr); - CORBA::Object_var aCorbaObj; - try { - aCorbaObj = GetORB()->string_to_object(anIORAttr->Value()); - } catch(...) { + CORBA::Object_var anObj = SObjectToObject(theObject); + if (CORBA::is_nil(anObj)) { aStreamFile->length(1); - aStreamFile[0] = strdup("E")[0]; - return aStreamFile._retn(); - } - if (CORBA::is_nil(aCorbaObj)) { - return NULL; - } - - Storable* pStorable = dynamic_cast(GetServant(aCorbaObj).in()); - if (!pStorable) { - return NULL; - } + aStreamFile[0] = CORBA::string_dup("E")[0]; + } else if (Storable* aStorable = dynamic_cast(GetServant(anObj).in())) { + std::string aTmpDir = SALOMEDS_Tool::GetTmpDir(); + Storable::TFileNames aFileNames; + bool anIsDone = aStorable->CopyFrom(theObject, theObjectID, aTmpDir, aFileNames); - string aTmpDir = SALOMEDS_Tool::GetTmpDir(); - string aCopyPersist = aTmpDir + "copy_persistent"; - - ofstream stmOut2(aCopyPersist.c_str(),ios::out); - string aStr = pStorable->ToString().c_str(); - stmOut2<(GetServant(aCorbaObj).in())) { - string aFileName = string(SALOMEDS_Tool::GetNameFromPath(theObject->GetStudy()->URL())) + "_"; - if(strlen(aFileName.c_str()) == 1) aFileName=""; - const QFileInfo& aFileInfo = aResultObj->GetFileInfo(); - aFileName += aFileInfo.fileName().latin1(); - static QString aCommand; - string aFullFileName = aTmpDir + aFileName; - aCommand.sprintf(" %s %s",aFileInfo.filePath().latin1(), aFullFileName.c_str() ); - aCommand = QDir::convertSeparators( aCommand ); - aCommand.prepend( COPY_COMMAND ); - - if(system(aCommand.latin1()) == -1) { - if(MYDEBUG) MESSAGE("VISU_Gen_i::Copy - Cann't execute the command :"<length(2); - aSeq[0] = "copy_persistent"; - aSeq[1] = aFileName.c_str(); - } else { - aSeq->length(1); - aSeq[0] = "copy_persistent"; - } - - aStreamFile = SALOMEDS_Tool::PutFilesToStream(aTmpDir.c_str(), aSeq.in(), false); - SALOMEDS_Tool::RemoveTemporaryFiles(aTmpDir.c_str(), aSeq.in(), true); + SALOMEDS::ListOfFileNames_var aListOfFileNames = new SALOMEDS::ListOfFileNames; + aListOfFileNames->length(aFileNames.size()); + for(size_t anId = 0; anId < aFileNames.size(); anId++) + aListOfFileNames[anId] = aFileNames[anId].c_str(); - // Assign an ID = 1 the the type VISU::Result - theObjectID = 1; + if(anIsDone) + aStreamFile = SALOMEDS_Tool::PutFilesToStream(aTmpDir, aListOfFileNames.in(), false); - SALOMEDS::SComponent_var aSComponent = theObject->GetStudy()->FindComponent("VISU"); + SALOMEDS_Tool::RemoveTemporaryFiles(aTmpDir.c_str(), aListOfFileNames.in(), true); + } return aStreamFile._retn(); } @@ -1364,10 +1264,10 @@ namespace VISU VISU_Gen_i ::CanPaste(const char* theComponentName, CORBA::Long theObjectID) { // The VISU component can paste only objects copied by VISU component - // and with the object type = 1 - if (strcmp(theComponentName, ComponentDataType()) != 0 || theObjectID != 1) - return false; - return true; + CORBA::String_var aString = ComponentDataType(); + if (strcmp(theComponentName, aString.in()) == 0 && theObjectID == 1) + return true; + return false; } @@ -1376,59 +1276,55 @@ namespace VISU VISU_Gen_i ::PasteInto(const SALOMEDS::TMPFile& theStream, CORBA::Long theObjectID, - SALOMEDS::SObject_ptr theObject) + SALOMEDS::SObject_ptr theSObject) { - Mutex mt(myMutex); - SALOMEDS::SObject_var aResultSO; if (theObjectID != 1) - return aResultSO._retn(); - - string aTmpDir = SALOMEDS_Tool::GetTmpDir(); - SALOMEDS::ListOfFileNames_var aSeq = SALOMEDS_Tool::PutStreamToFiles(theStream, aTmpDir.c_str(), false); - - ifstream stmIn((aTmpDir + string("copy_persistent")).c_str()); - stmIn.seekg(0, ios::end); - int aLength = stmIn.tellg(); - stmIn.seekg(0, ios::beg); - char* aString = new char[aLength+1]; - stmIn.read(aString, aLength); - stmIn.close(); - aString[aLength] = 0; - myIsMultiFile = false; - - string aFileName(aTmpDir); - string aBasicFileName; - if(aSeq->length() > 1) { - aBasicFileName = aSeq[1].in(); - aFileName += aBasicFileName; - } + return SALOMEDS::SObject::_nil(); - SALOMEDS::SComponent_var aComponent = theObject->GetFatherComponent(); - SALOMEDS::Study_var aStudy = theObject->GetStudy(); + SALOMEDS::SComponent_var aComponent = theSObject->GetFatherComponent(); + SALOMEDS::Study_var aStudy = theSObject->GetStudy(); SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder(); - CORBA::String_var aComponentID(aComponent->GetID()), aSObjID(theObject->GetID()); - - if (strcmp(aComponentID, aSObjID) == 0) //create the new result SObject - aResultSO = aStudyBuilder->NewObject(aComponent); + CORBA::String_var aComponentID(aComponent->GetID()); + CORBA::String_var aSObjectID(theSObject->GetID()); + + SALOMEDS::SObject_var aSObject; + if (strcmp(aComponentID, aSObjectID) == 0) //create the new result SObject + aSObject = aStudyBuilder->NewObject(aComponent); else - aResultSO = SALOMEDS::SObject::_duplicate(theObject); - + aSObject = SALOMEDS::SObject::_duplicate(theSObject); + + std::string aTmpDir = SALOMEDS_Tool::GetTmpDir(); + SALOMEDS::ListOfFileNames_var aListOfFileNames = + SALOMEDS_Tool::PutStreamToFiles(theStream, aTmpDir, false); + if(MYDEBUG) MESSAGE("Result_i::PasteInto - aListOfFileNames->length() = "<length()); + + std::string aLocalPersistentID; + { + std::string aCopyPersist = aTmpDir + "copy_persistent"; + std::ifstream anInputFileStream(aCopyPersist.c_str()); + anInputFileStream>>aLocalPersistentID; + anInputFileStream.close(); + } + //Just for Result::Restore to find the Comment attribute :( - SALOMEDS::GenericAttribute_var anAttr = aStudyBuilder->FindOrCreateAttribute(aResultSO, "AttributeString"); - - Storable* aStorable = Storable::Create(aResultSO,aFileName,aString); - - SALOMEDS::ListOfFileNames_var aSeqToRm = new SALOMEDS::ListOfFileNames; - aSeqToRm->length(1); - aSeqToRm[0] = "copy_persistent"; - - SALOMEDS_Tool::RemoveTemporaryFiles(aTmpDir.c_str(), aSeqToRm.in(), true); - - anAttr = aStudyBuilder->FindOrCreateAttribute(aResultSO, "AttributeIOR"); + SALOMEDS::GenericAttribute_var anAttr = aStudyBuilder->FindOrCreateAttribute(aSObject, "AttributeString"); + + std::string aFileName(aTmpDir); + if(aListOfFileNames->length() > 1) + aFileName += aListOfFileNames[1].in(); + Storable* aStorable = Storable::Create(aSObject, aLocalPersistentID, aFileName, false); + + SALOMEDS::ListOfFileNames_var aFilesToRemove = new SALOMEDS::ListOfFileNames; + aFilesToRemove->length(1); + aFilesToRemove[0] = aListOfFileNames[0]; + SALOMEDS_Tool::RemoveTemporaryFiles(aTmpDir, aFilesToRemove.in(), true); + + anAttr = aStudyBuilder->FindOrCreateAttribute(aSObject, "AttributeIOR"); SALOMEDS::AttributeIOR_var anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr); CORBA::String_var anIORValue(aStorable->GetID()); anIOR->SetValue(anIORValue); - return aResultSO._retn(); + + return aSObject._retn(); } diff --git a/src/VISU_I/VISU_Mesh_i.cc b/src/VISU_I/VISU_Mesh_i.cc index 5df41e26..01496c58 100644 --- a/src/VISU_I/VISU_Mesh_i.cc +++ b/src/VISU_I/VISU_Mesh_i.cc @@ -454,9 +454,10 @@ VISU::Mesh_i //---------------------------------------------------------------------------- VISU::Storable* VISU::Mesh_i -::Restore(SALOMEDS::SObject_ptr theSObject, - const string& thePrefix, - const Storable::TRestoringMap& theMap) +::StorableEngine(SALOMEDS::SObject_ptr theSObject, + const Storable::TRestoringMap& theMap, + const std::string& thePrefix, + CORBA::Boolean theIsMultiFile) { Mesh_i* aMesh = new Mesh_i(); return aMesh->Restore(theSObject, theMap); diff --git a/src/VISU_I/VISU_Mesh_i.hh b/src/VISU_I/VISU_Mesh_i.hh index a6b45221..6576b7be 100644 --- a/src/VISU_I/VISU_Mesh_i.hh +++ b/src/VISU_I/VISU_Mesh_i.hh @@ -167,9 +167,10 @@ namespace VISU static Storable* - Restore(SALOMEDS::SObject_ptr theSObject, - const std::string& thePrefix, - const Storable::TRestoringMap& theMap); + StorableEngine(SALOMEDS::SObject_ptr theSObject, + const Storable::TRestoringMap& theMap, + const std::string& thePrefix, + CORBA::Boolean theIsMultiFile); virtual VISU_Actor* diff --git a/src/VISU_I/VISU_MultiResult_i.cc b/src/VISU_I/VISU_MultiResult_i.cc index ff71ddce..1b5af1c6 100644 --- a/src/VISU_I/VISU_MultiResult_i.cc +++ b/src/VISU_I/VISU_MultiResult_i.cc @@ -460,9 +460,10 @@ VISU::Storable* VISU::MultiResult_i ::Restore(SALOMEDS::SObject_ptr theSObject, const Storable::TRestoringMap& theMap, - const string& thePrefix) + const std::string& thePrefix, + CORBA::Boolean theIsMultiFile) { - if(!TSuperClass::Restore(theSObject, theMap, thePrefix)) + if(!TSuperClass::Restore(theSObject, theMap, thePrefix, theIsMultiFile)) return NULL; QStringList aResolutions = QStringList::split("|", VISU::Storable::FindValue(theMap, "myResolutions")); diff --git a/src/VISU_I/VISU_MultiResult_i.hh b/src/VISU_I/VISU_MultiResult_i.hh index 49d6bc89..fe100b8c 100644 --- a/src/VISU_I/VISU_MultiResult_i.hh +++ b/src/VISU_I/VISU_MultiResult_i.hh @@ -49,10 +49,10 @@ namespace VISU MultiResult_i(SALOMEDS::Study_ptr theStudy, const ESourceId& theSourceId, const ECreationId& theCreationId, - CORBA::Boolean theIsBuildImmediately = true, - CORBA::Boolean theIsBuildFields = true, - CORBA::Boolean theIsBuildMinMax = true, - CORBA::Boolean theIsBuildGroups = true); + CORBA::Boolean theIsBuildImmediately, + CORBA::Boolean theIsBuildFields, + CORBA::Boolean theIsBuildMinMax, + CORBA::Boolean theIsBuildGroups); virtual ~MultiResult_i(); @@ -115,7 +115,8 @@ namespace VISU Storable* Restore(SALOMEDS::SObject_ptr theSObject, const Storable::TRestoringMap& theMap, - const std::string& thePrefix); + const std::string& thePrefix, + CORBA::Boolean theIsMultiFile); virtual void diff --git a/src/VISU_I/VISU_Result_i.cc b/src/VISU_I/VISU_Result_i.cc index c199ec62..d5ab7ab5 100644 --- a/src/VISU_I/VISU_Result_i.cc +++ b/src/VISU_I/VISU_Result_i.cc @@ -585,12 +585,135 @@ VISU::Result_i } +//--------------------------------------------------------------- +bool +VISU::Result_i +::Save(SALOMEDS::SComponent_ptr theComponent, + const char* theTmpDir, + bool theIsMultiFile, + std::string& theFileName, + std::string& theFilePath) +{ + switch(GetCreationId()){ + case Result_i::eImportFile: + case Result_i::eCopyAndImportFile: { + theFileName = std::string("_") + GetName(); + theFilePath = GetFileInfo().filePath().latin1(); + if(theIsMultiFile){ + CORBA::String_var anURL = GetStudyDocument()->URL(); + theFileName = SALOMEDS_Tool::GetNameFromPath(anURL.in()) + theFileName; + + std::ostringstream aCommand; + aCommand<URL(); + aPrefix = SALOMEDS_Tool::GetNameFromPath(anURL.in()); + } + theFileName = aPrefix + "_" + GetName(); + + QString aTmpDir = QDir::convertSeparators(theTmpDir.c_str()); + QString aCommand; + aCommand.sprintf("%s %s%s", + GetFileInfo().filePath().latin1(), + aTmpDir.latin1(), + theFileName.c_str()); + aCommand = QDir::convertSeparators( aCommand ); + aCommand.prepend( COPY_COMMAND ); + + if(system(aCommand.latin1())){ + if(MYDEBUG) MESSAGE("Result_i::SaveASCII - Can't execute the command :"<(aStudyPath.latin1()), true); + return true; + }} + + return false; +} + + +//--------------------------------------------------------------- +CORBA::Boolean +VISU::Result_i +::CanCopy(SALOMEDS::SObject_ptr theObject) +{ + switch(GetCreationId()){ + case Result_i::eImportFile: + case Result_i::eCopyAndImportFile: + return true; + } + + return false; +} + + +//--------------------------------------------------------------- +bool +VISU::Result_i +::CopyFrom(SALOMEDS::SObject_ptr theObject, + CORBA::Long& theObjectID, + const std::string& theTmpDir, + TFileNames& theFileNames) +{ + if(!Storable::CopyFrom(theObject, theObjectID, theTmpDir, theFileNames)) + return false; + + SALOMEDS::Study_var aStudy = theObject->GetStudy(); + CORBA::String_var anURL = aStudy->URL(); + std::string aPrefix = SALOMEDS_Tool::GetNameFromPath(anURL.in()); + std::string aFileName = aPrefix + GetFileInfo().fileName().latin1(); + + static QString aCommand; + std::string aFilePath = theTmpDir + aFileName; + aCommand.sprintf(" %s %s", GetFileInfo().filePath().latin1(), aFilePath.c_str()); + aCommand = QDir::convertSeparators( aCommand ); + aCommand.prepend( COPY_COMMAND ); + + if(system(aCommand.latin1()) != 0) { + if(MYDEBUG) MESSAGE("VISU_Gen_i::Copy - Cann't execute the command :"<FindComponent("VISU"); + + theFileNames.push_back(aFileName); + + return true; +} + + //--------------------------------------------------------------- VISU::Storable* VISU::Result_i ::Restore(SALOMEDS::SObject_ptr theSObject, const Storable::TRestoringMap& theMap, - const string& thePrefix) + const string& thePrefix, + CORBA::Boolean theIsMultiFile) { if(MYDEBUG) MESSAGE("Result_i::Restore - " << thePrefix); try { @@ -636,7 +759,7 @@ VISU::Result_i myFileInfo.setFile(thePrefix.c_str()); string aStudyPrefix (""); - if (IsMultifile()) + if (theIsMultiFile) aStudyPrefix = SALOMEDS_Tool::GetNameFromPath(myStudyDocument->URL()); if (!myFileInfo.isFile()) { string aFileName = thePrefix + aStudyPrefix + "_" + myName; @@ -653,7 +776,7 @@ VISU::Result_i char* aHDFFileName = new char[strlen(aResultPath) + 19]; sprintf(aHDFFileName, "%shdf_from_ascii.hdf", aResultPath); - if (IsMultifile()) { // set this file as new - temporary + if (theIsMultiFile) { // set this file as new - temporary static QString aCommand; aCommand.sprintf(" %s %s%s",aHDFFileName, aResultPath, myFileInfo.baseName().latin1()); aCommand = QDir::convertSeparators( aCommand ); @@ -684,7 +807,7 @@ VISU::Result_i mySourceId = eRestoredFile; delete(aResultPath); delete(aHDFFileName); - } else if (!IsMultifile()) { + } else if (!theIsMultiFile) { mySourceId = eRestoredFile; } else { mySourceId = eFile; @@ -833,9 +956,10 @@ VISU::Result_i //--------------------------------------------------------------- VISU::Storable* VISU::Result_i -::Restore(SALOMEDS::SObject_ptr theSObject, - const string& thePrefix, - const Storable::TRestoringMap& theMap) +::StorableEngine(SALOMEDS::SObject_ptr theSObject, + const Storable::TRestoringMap& theMap, + const std::string& thePrefix, + CORBA::Boolean theIsMultiFile) { SALOMEDS::Study_var aStudy = theSObject->GetStudy(); @@ -851,13 +975,14 @@ VISU::Result_i VISU::Result_i* aResult = new RESULT_CLASS_NAME(aStudy, aSourceId, aCreationId, + true, anIsBuildFields, anIsBuildMinMax, anIsBuildGroups); if (aResult == NULL) return NULL; - return aResult->Restore(theSObject, theMap, thePrefix); + return aResult->Restore(theSObject, theMap, thePrefix, theIsMultiFile); } diff --git a/src/VISU_I/VISU_Result_i.hh b/src/VISU_I/VISU_Result_i.hh index 191dafd3..c4a14f5b 100644 --- a/src/VISU_I/VISU_Result_i.hh +++ b/src/VISU_I/VISU_Result_i.hh @@ -218,18 +218,49 @@ namespace VISU Storable* Restore(SALOMEDS::SObject_ptr theSObject, const Storable::TRestoringMap& theMap, - const std::string& thePrefix); + const std::string& thePrefix, + CORBA::Boolean theIsMultiFile); static Storable* - Restore(SALOMEDS::SObject_ptr theSObject, - const std::string& thePrefix, - const Storable::TRestoringMap& theMap); + StorableEngine(SALOMEDS::SObject_ptr theSObject, + const Storable::TRestoringMap& theMap, + const std::string& thePrefix, + CORBA::Boolean theIsMultiFile); virtual void ToStream(std::ostringstream& theStr); + //--------------------------------------------------------------- + virtual + bool + Save(SALOMEDS::SComponent_ptr theComponent, + const char* theURL, + bool theIsMultiFile, + std::string& theFileName, + std::string& theFilePath); + + virtual + bool + SaveASCII(SALOMEDS::SComponent_ptr theComponent, + const std::string& theURL, + bool theIsMultiFile, + std::string& theFileName); + + //--------------------------------------------------------------- + virtual + CORBA::Boolean + CanCopy(SALOMEDS::SObject_ptr theObject); + + virtual + bool + CopyFrom(SALOMEDS::SObject_ptr theObject, + CORBA::Long& theObjectID, + const std::string& theTmpDir, + TFileNames& theFileNames); + + //--------------------------------------------------------------- virtual const char* GetComment() const; diff --git a/src/VISU_I/VISU_Table_i.cc b/src/VISU_I/VISU_Table_i.cc index 5e037ba1..2d1854bc 100644 --- a/src/VISU_I/VISU_Table_i.cc +++ b/src/VISU_I/VISU_Table_i.cc @@ -292,8 +292,10 @@ void VISU::Table_i::ToStream( std::ostringstream& theStr ) /*! Called from engine to restore table from the file */ -VISU::Storable* VISU::Table_i::Restore(SALOMEDS::SObject_ptr theSObject, - const string& thePrefix, const Storable::TRestoringMap& theMap) +VISU::Storable* VISU::Table_i::StorableEngine(SALOMEDS::SObject_ptr theSObject, + const Storable::TRestoringMap& theMap, + const std::string& thePrefix, + CORBA::Boolean theIsMultiFile) { SALOMEDS::Study_var aStudy = theSObject->GetStudy(); VISU::Table_i* pResent = new VISU::Table_i( aStudy, "" ); @@ -843,8 +845,10 @@ const char* VISU::Curve_i::GetTableID() { /*! Called from engine to restore curve from the file */ -VISU::Storable* VISU::Curve_i::Restore(SALOMEDS::SObject_ptr theSObject, - const string& thePrefix, const Storable::TRestoringMap& theMap) +VISU::Storable* VISU::Curve_i::StorableEngine(SALOMEDS::SObject_ptr theSObject, + const Storable::TRestoringMap& theMap, + const std::string& thePrefix, + CORBA::Boolean theIsMultiFile) { SALOMEDS::Study_var aStudy = theSObject->GetStudy(); VISU::Table_i* pTable = GetTable(aStudy, theSObject->GetFather()); @@ -1136,8 +1140,10 @@ void VISU::Container_i::ToStream( std::ostringstream& theStr ) /*! Called from engine to restore container from the file */ -VISU::Storable* VISU::Container_i::Restore(SALOMEDS::SObject_ptr theSObject, - const string& thePrefix, const Storable::TRestoringMap& theMap) +VISU::Storable* VISU::Container_i::StorableEngine(SALOMEDS::SObject_ptr theSObject, + const Storable::TRestoringMap& theMap, + const std::string& thePrefix, + CORBA::Boolean theIsMultiFile) { SALOMEDS::Study_var aStudy = theSObject->GetStudy(); VISU::Container_i* pResent = new VISU::Container_i( aStudy ); diff --git a/src/VISU_I/VISU_Table_i.hh b/src/VISU_I/VISU_Table_i.hh index b241a6b9..04806091 100644 --- a/src/VISU_I/VISU_Table_i.hh +++ b/src/VISU_I/VISU_Table_i.hh @@ -71,9 +71,10 @@ namespace VISU{ virtual Storable* Restore( const Storable::TRestoringMap& theMap, SALOMEDS::SObject_ptr SO); - static Storable* Restore(SALOMEDS::SObject_ptr theSObject, - const std::string& thePrefix, - const Storable::TRestoringMap& theMap); + static Storable* StorableEngine(SALOMEDS::SObject_ptr theSObject, + const Storable::TRestoringMap& theMap, + const std::string& thePrefix, + CORBA::Boolean theIsMultiFile); virtual void ToStream( std::ostringstream& theStr ); static const std::string myComment; @@ -140,9 +141,10 @@ namespace VISU{ virtual Storable* Restore( const Storable::TRestoringMap& theMap, SALOMEDS::SObject_ptr theSO); - static Storable* Restore(SALOMEDS::SObject_ptr theSObject, - const std::string& thePrefix, - const Storable::TRestoringMap& theMap); + static Storable* StorableEngine(SALOMEDS::SObject_ptr theSObject, + const Storable::TRestoringMap& theMap, + const std::string& thePrefix, + CORBA::Boolean theIsMultiFile); virtual void ToStream( std::ostringstream& theStr ); static const std::string myComment; @@ -194,9 +196,10 @@ namespace VISU{ virtual Storable* Create(); virtual Storable* Restore( const Storable::TRestoringMap& theMap, SALOMEDS::SObject_ptr SO ); - static Storable* Restore(SALOMEDS::SObject_ptr theSObject, - const std::string& thePrefix, - const Storable::TRestoringMap& theMap); + static Storable* StorableEngine(SALOMEDS::SObject_ptr theSObject, + const Storable::TRestoringMap& theMap, + const std::string& thePrefix, + CORBA::Boolean theIsMultiFile); virtual void ToStream( std::ostringstream& theStr ); static const std::string myComment; -- 2.39.2