#include <qregexp.h>
-using namespace std;
+#include <fstream>
#ifdef _DEBUG_
static int MYDEBUG = 0;
static int MYDEBUG = 0;
#endif
-namespace VISU{
+
+namespace VISU
+{
SUIT_Session*
GetSession()
//---------------------------------------------------------------------------
- static Storable::TCallbackMap VisuStoreMap;
+ Storable::TStorableEngineMap Storable::myStorableEngineMap;
std::string
Storable
}
+ //---------------------------------------------------------------
+ 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<<ToString()<<endl;
+
+ theFileNames.push_back(aFileName);
+ theObjectID = 1;
+
+ return true;
+ }
+
+
//---------------------------------------------------------------
void
Storable
- ::Registry(const std::string& theComment,
- TStorableEngine theEngine)
+ ::RegistryStorableEngine(const std::string& theComment,
+ TStorableEngine theEngine)
{
- if(!VisuStoreMap.insert(TCallbackMap::value_type(theComment,theEngine)).second){
- if(MYDEBUG) MESSAGE("Storable::Registry >> 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 - "<<aComment.latin1()<<" "<<(anIter != myStorableEngineMap.end()));
+ if(anIter == myStorableEngineMap.end())
+ return NULL;
+ TStorableEngine aStorableEngine = anIter->second;
+ return aStorableEngine(theSObject, aRestoringMap, thePrefix, theIsMultiFile);
+ }
+ }catch(std::exception& exc){
+ INFOS("Follow exception was occured :\n"<<exc.what());
+ }catch(...){
+ INFOS("Unknown exception was occured!");
}
+ return NULL;
}
}
- //---------------------------------------------------------------
- Storable*
- Storable
- ::Create(SALOMEDS::SObject_ptr theSObject,
- const std::string& thePrefix,
- const std::string& theLocalPersistentID)
- {
- try{
- QString aString( CorrectPersistentString( theLocalPersistentID ) );
- TRestoringMap aRestoringMap;
- StringToMap(aString, aRestoringMap);
- bool anIsExists;
- QString aComment = VISU::Storable::FindValue(aRestoringMap, "myComment", &anIsExists);
- if ( anIsExists ) {
- TCallbackMap::const_iterator anIter = VisuStoreMap.find(aComment.latin1());
- if(MYDEBUG) MESSAGE("Storable::Create - "<<aComment.latin1()<<" "<<(anIter != VisuStoreMap.end()));
- if(anIter == VisuStoreMap.end())
- return NULL;
- TStorableEngine aStorableEngine = anIter->second;
- return aStorableEngine(theSObject, thePrefix, aRestoringMap);
- }
- }catch(std::exception& exc){
- INFOS("Follow exception was occured :\n"<<exc.what());
- }catch(...){
- INFOS("Unknown exception was occured!");
- }
- return NULL;
- }
-
-
//---------------------------------------------------------------
QString
Storable
PortableServer::ServantBase_var
GetServant(CORBA::Object_ptr theObject)
{
- if(CORBA::is_nil(theObject)) return NULL;
+ if(CORBA::is_nil(theObject))
+ return NULL;
try{
PortableServer::POA_ptr aPOA = Base_i::GetPOA();
PortableServer::Servant aServant = aPOA->reference_to_servant(theObject);
//===========================================================================
class VISU_I_EXPORT Storable : public virtual Base_i
{
- protected:
- virtual void ToStream(std::ostringstream& theStr) = 0;
public:
std::string
ToString();
const char*
GetComment() const = 0;
+
+ //---------------------------------------------------------------
typedef std::map<std::string, QString> TRestoringMap;
typedef Storable* (*TStorableEngine)(SALOMEDS::SObject_ptr theSObject,
+ const TRestoringMap& theMap,
const std::string& thePrefix,
- const TRestoringMap& theMap);
- typedef std::map<std::string,TStorableEngine> TCallbackMap;
+ CORBA::Boolean theIsMultiFile);
+
+ typedef std::map<std::string, TStorableEngine> 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);
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,
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<TFileName> 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);
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);
}
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
//---------------------------------------------------------------
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();
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
//----------------------------------------------------------------------------
template<class TColoredPrs3d>
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);
static std::string VISU_TMP_DIR;
static CORBA::Boolean myIsMultiFile;
- const CORBA::Boolean IsMultifile() { return myIsMultiFile;}
+ const CORBA::Boolean IsMultiFile()
+ {
+ return myIsMultiFile;
+ }
//----------------------------------------------------------------------------
_PTR(SComponent)
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<ScalarMap_i>));
- Storable::Registry(GaussPoints_i::myComment.c_str(),&(Restore<GaussPoints_i>));
- Storable::Registry(DeformedShape_i::myComment.c_str(),&(Restore<DeformedShape_i>));
- Storable::Registry(CutPlanes_i::myComment.c_str(),&(Restore<CutPlanes_i>));
- Storable::Registry(CutLines_i::myComment.c_str(),&(Restore<CutLines_i>));
- Storable::Registry(IsoSurfaces_i::myComment.c_str(),&(Restore<IsoSurfaces_i>));
- Storable::Registry(StreamLines_i::myComment.c_str(),&(Restore<StreamLines_i>));
- Storable::Registry(Plot3D_i::myComment.c_str(),&(Restore<Plot3D_i>));
- Storable::Registry(Vectors_i::myComment.c_str(),&(Restore<Vectors_i>));
- 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<ScalarMapOnDeformedShape_i>));
- 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<ScalarMap_i>));
+ Storable::RegistryStorableEngine(GaussPoints_i::myComment.c_str(),&(StorableEngine<GaussPoints_i>));
+ Storable::RegistryStorableEngine(DeformedShape_i::myComment.c_str(),&(StorableEngine<DeformedShape_i>));
+ Storable::RegistryStorableEngine(CutPlanes_i::myComment.c_str(),&(StorableEngine<CutPlanes_i>));
+ Storable::RegistryStorableEngine(CutLines_i::myComment.c_str(),&(StorableEngine<CutLines_i>));
+ Storable::RegistryStorableEngine(IsoSurfaces_i::myComment.c_str(),&(StorableEngine<IsoSurfaces_i>));
+ Storable::RegistryStorableEngine(StreamLines_i::myComment.c_str(),&(StorableEngine<StreamLines_i>));
+ Storable::RegistryStorableEngine(Plot3D_i::myComment.c_str(),&(StorableEngine<Plot3D_i>));
+ Storable::RegistryStorableEngine(Vectors_i::myComment.c_str(),&(StorableEngine<Vectors_i>));
+ Storable::RegistryStorableEngine(ScalarMapOnDeformedShape_i::myComment.c_str(),&(StorableEngine<ScalarMapOnDeformedShape_i>));
+
+ 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));
}
::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();
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();
}
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 - "<<aTmpDir);
+ if(MYDEBUG) MESSAGE("VISU_Gen_i::Save - theTmpDir = '"<<theTmpDir<<"'");
typedef std::vector<std::string> 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<Result_i*>(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 "<<aFile<<" "<<aTmpDir<<aFileName;
- std::string aCommand = aStream.str();
- if(system(aCommand.c_str()) != 0){
- INFOS("VISU_Gen_i::Save - Cann't execute the command :"<<aCommand);
- continue;
- }
- }
+ std::string aFileName, aFilePath;
+ if(aResult->Save(theComponent, theTmpDir, theIsMultiFile, aFileName, aFilePath)){
aFileNames.push_back(aFileName);
- aFiles.push_back(aFile);
- }}
+ aFilePathes.push_back(aFilePath);
+ }
}
}
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();
}
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<char*>(aDir.c_str()));
+ std::string aTmpDir = theIsMultiFile ? theTmpDir : SALOMEDS_Tool::GetTmpDir();
if(MYDEBUG) MESSAGE("VISU_Gen_i::Save - "<<aTmpDir);
int aCounter = 0;
TColStd_SequenceOfAsciiString aFileNames;
SALOMEDS::Study_var aStudy = theComponent->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<Result_i*>(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 :"<<aCommand);
- continue;
- }else
- if(MYDEBUG) MESSAGE("VISU_Gen_i::Save - "<<aCommand);
-
- QString studyPath = tmpDir.append(aFileName);
- TCollection_AsciiString aString((char *)(aFileName.latin1()));
-
- HDFascii::ConvertFromHDFToASCII(strdup(studyPath.latin1()), true);
-
+ if(CORBA::is_nil(anObj))
+ continue;
+ if(Result_i* aResult = dynamic_cast<Result_i*>(GetServant(anObj).in())){
+ std::string aFileName;
+ if(aResult->SaveASCII(theComponent, aTmpDir, theIsMultiFile, aFileName)){
+ TCollection_AsciiString aString(const_cast<char*>(aFileName.c_str()));
aFileNames.Append(aString);
- }}
+ }
}
}
SALOMEDS::TMPFile_var aStreamFile = new SALOMEDS::TMPFile(0);
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();
}
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<Storable*>(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<Storable*>(GetServant(anObj).in())){
+ aString = aStorable->ToString().c_str();
+ return aString._retn();
}
}
return aString._retn();
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<Result_i*>(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"<<exc.what());
- }catch (...){
- INFOS("Unknown exception was occured!");
- }
+ CORBA::Object_var anObj = SObjectToObject(theObject);
+ if (Storable* aStorable = dynamic_cast<Storable*>(GetServant(anObj).in()))
+ return aStorable->CanCopy(theObject);
+
return false;
}
//---------------------------------------------------------------
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<Storable*>(GetServant(aCorbaObj).in());
- if (!pStorable) {
- return NULL;
- }
+ aStreamFile[0] = CORBA::string_dup("E")[0];
+ } else if (Storable* aStorable = dynamic_cast<Storable*>(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<<aStr<<endl;
- stmOut2.close();
-
- if (Result_i* aResultObj = dynamic_cast<Result_i*>(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 :"<<aCommand);
- return NULL;
- }
- aSeq->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();
}
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;
}
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() = "<<aListOfFileNames->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();
}
//----------------------------------------------------------------------------
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);
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*
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"));
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();
Storable*
Restore(SALOMEDS::SObject_ptr theSObject,
const Storable::TRestoringMap& theMap,
- const std::string& thePrefix);
+ const std::string& thePrefix,
+ CORBA::Boolean theIsMultiFile);
virtual
void
}
+//---------------------------------------------------------------
+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<<COPY_COMMAND<<theFilePath<<" "<<theTmpDir<<theFileName;
+ if(system(aCommand.str().c_str()) != 0)
+ return false;
+ }
+ return true;
+ }}
+
+ return false;
+}
+
+
+//---------------------------------------------------------------
+bool
+VISU::Result_i
+::SaveASCII(SALOMEDS::SComponent_ptr theComponent,
+ const std::string& theTmpDir,
+ bool theIsMultiFile,
+ std::string& theFileName)
+{
+ switch(GetCreationId()){
+ case Result_i::eImportFile:
+ case Result_i::eCopyAndImportFile: {
+ std::string aPrefix;
+ if (theIsMultiFile) {
+ CORBA::String_var anURL = GetStudyDocument()->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 :"<<aCommand);
+ return false;
+ }else
+ if(MYDEBUG) MESSAGE("Result_i::SaveASCII - "<<aCommand);
+
+ QString aStudyPath = aTmpDir.append(theFileName.c_str());
+ HDFascii::ConvertFromHDFToASCII(const_cast<char*>(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 :"<<aCommand);
+ return false;
+ }
+
+ SALOMEDS::SComponent_var aSComponent = aStudy->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 {
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;
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 );
mySourceId = eRestoredFile;
delete(aResultPath);
delete(aHDFFileName);
- } else if (!IsMultifile()) {
+ } else if (!theIsMultiFile) {
mySourceId = eRestoredFile;
} else {
mySourceId = eFile;
//---------------------------------------------------------------
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();
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);
}
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;
/*!
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, "" );
/*!
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());
/*!
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 );
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;
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;
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;