namespace VISU
{
//----------------------------------------------------------------------------
- static string VisuTmpDir;
+ static std::string VISU_TMP_DIR;
static CORBA::Boolean myIsMultiFile;
const CORBA::Boolean IsMultifile() { return myIsMultiFile;}
::Load(SALOMEDS::SComponent_ptr theComponent,
const SALOMEDS::TMPFile & theStream,
const char* theURL,
- bool isMultiFile)
+ bool theIsMultiFile)
{
Mutex mt(myMutex);
SALOMEDS::Study_var aStudy = theComponent->GetStudy();
}
- string aDir = isMultiFile ? theURL : SALOMEDS_Tool::GetTmpDir();
- TCollection_AsciiString aTmpDir (const_cast<char*>(aDir.c_str()));
- VisuTmpDir = aTmpDir.ToCString();
+ VISU_TMP_DIR = theIsMultiFile ? theURL : SALOMEDS_Tool::GetTmpDir();
SALOMEDS::ListOfFileNames_var aSeq =
- SALOMEDS_Tool::PutStreamToFiles(theStream, aTmpDir.ToCString(),isMultiFile);
- myIsMultiFile = isMultiFile;
+ SALOMEDS_Tool::PutStreamToFiles(theStream, VISU_TMP_DIR, theIsMultiFile);
+ myIsMultiFile = theIsMultiFile;
return true;
}
::LoadASCII(SALOMEDS::SComponent_ptr theComponent,
const SALOMEDS::TMPFile & theStream,
const char* theURL,
- bool isMultiFile)
+ bool theIsMultiFile)
{
- return Load(theComponent, theStream, theURL, isMultiFile);
+ return Load(theComponent, theStream, theURL, theIsMultiFile);
}
VISU_Gen_i
::LocalPersistentIDToIOR(SALOMEDS::SObject_ptr theSObject,
const char* aLocalPersistentID,
- CORBA::Boolean isMultiFile,
- CORBA::Boolean isASCII)
+ CORBA::Boolean theIsMultiFile,
+ CORBA::Boolean theIsASCII)
{
CORBA::String_var aString("");
if(strcmp(aLocalPersistentID,"") != 0) {
Mutex mt(myMutex);
Storable* aStorable =
- Storable::Create(theSObject,VisuTmpDir.c_str(),aLocalPersistentID);
- if(aStorable != NULL) aString = aStorable->GetID();
+ Storable::Create(theSObject, VISU_TMP_DIR.c_str(), aLocalPersistentID);
+ if(aStorable != NULL)
+ aString = aStorable->GetID();
}
return aString._retn();
}
VISU_Gen_i
::SaveASCII(SALOMEDS::SComponent_ptr theComponent,
const char* theURL,
- bool isMultiFile)
+ bool theIsMultiFile)
{
Mutex mt(myMutex);
- string aDir = isMultiFile ? theURL : SALOMEDS_Tool::GetTmpDir();
+ string aDir = theIsMultiFile ? theURL : SALOMEDS_Tool::GetTmpDir();
TCollection_AsciiString aTmpDir (const_cast<char*>(aDir.c_str()));
if(MYDEBUG) MESSAGE("VISU_Gen_i::Save - "<<aTmpDir);
int aCounter = 0;
case Result_i::eCopyAndImportFile: {
const QFileInfo& aFileInfo = pResult->GetFileInfo();
QString aPrefix("");
- if (isMultiFile) aPrefix = SALOMEDS_Tool::GetNameFromPath(aStudy->URL()).c_str();
+ 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())){
+ 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);
+ QString studyPath = tmpDir.append(aFileName);
TCollection_AsciiString aString((char *)(aFileName.latin1()));
-
- HDFascii::ConvertFromHDFToASCII(strdup(studyPath.latin1()), true);
+
+ HDFascii::ConvertFromHDFToASCII(strdup(studyPath.latin1()), true);
aFileNames.Append(aString);
}}
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(), isMultiFile);
- if(!isMultiFile)
+ aStreamFile = SALOMEDS_Tool::PutFilesToStream(aTmpDir.ToCString(), aSeq.in(), theIsMultiFile);
+ if(!theIsMultiFile)
SALOMEDS_Tool::RemoveTemporaryFiles(aTmpDir.ToCString(), aSeq.in(), true);
}
return aStreamFile._retn();
VISU_Gen_i
::IORToLocalPersistentID(SALOMEDS::SObject_ptr theSObject,
const char* IORString,
- CORBA::Boolean isMultiFile,
- CORBA::Boolean isASCII)
+ CORBA::Boolean theIsMultiFile,
+ CORBA::Boolean theIsASCII)
{
CORBA::String_var aString(IORString);
if(strcmp(IORString,"") != 0){
{
if(myStudyDocument->GetProperties()->IsLocked())
return SALOMEDS::SObject::_nil();
- Mutex mt(myMutex);
SALOMEDS::SObject_var aRes = VISU::ImportTables(theFileName,myStudyDocument);
return aRes._retn();
}
{
if(myStudyDocument->GetProperties()->IsLocked())
return Result::_nil();
- Mutex mt(myMutex);
- aFileInfo.setFile(theFileName);
- Result_i* pResult = Result_i::New(myStudyDocument,
+
+ Result_i* aResult = Result_i::New(myStudyDocument,
Result_i::eFile,
Result_i::eImportFile);
- if(pResult->Create(theFileName) != NULL)
- return pResult->_this();
- else{
- pResult->_remove_ref();
- return VISU::Result::_nil();
- }
+
+ if(aResult->Create(theFileName) != NULL)
+ return aResult->_this();
+ else
+ aResult->_remove_ref();
+
+ return VISU::Result::_nil();
}
{
if(myStudyDocument->GetProperties()->IsLocked())
return Result::_nil();
- Mutex mt(myMutex);
- aFileInfo.setFile(theFileName);
- Result_i* pResult = Result_i::New(myStudyDocument,
+
+ Result_i* aResult = Result_i::New(myStudyDocument,
Result_i::eFile,
Result_i::eImportFile,
false);
- if(pResult->Create(theFileName) != NULL)
- return pResult->_this();
- else{
- pResult->_remove_ref();
- return VISU::Result::_nil();
- }
+
+ if(aResult->Create(theFileName) != NULL)
+ return aResult->_this();
+ else
+ aResult->_remove_ref();
+
+ return VISU::Result::_nil();
}
{
if(myStudyDocument->GetProperties()->IsLocked())
return Result::_nil();
- Mutex mt(myMutex);
- VISU::Result_var aResult;
- aFileInfo.setFile(theFileName);
- Result_i* pResult = Result_i::New(myStudyDocument,
+
+ Result_i* aResult = Result_i::New(myStudyDocument,
Result_i::eRestoredFile,
Result_i::eCopyAndImportFile);
- if(pResult->Create(theFileName) != NULL)
- aResult = pResult->_this();
- return aResult._retn();
+ if(aResult->Create(theFileName) != NULL)
+ return aResult->_this();
+ else
+ aResult->_remove_ref();
+
+ return VISU::Result::_nil();
}
{
if (myStudyDocument->GetProperties()->IsLocked())
return Result::_nil();
- Mutex mt(myMutex);
- Result_i* pResult = Result_i::New(myStudyDocument,
+
+ Result_i* aResult = Result_i::New(myStudyDocument,
Result_i::eComponent,
Result_i::eImportMed);
- if (pResult->Create(theMedSObject) != NULL) {
- return pResult->_this();
- } else {
- pResult->_remove_ref();
- return VISU::Result::_nil();
- }
+ if (aResult->Create(theMedSObject) != NULL)
+ return aResult->_this();
+ else
+ aResult->_remove_ref();
+
+ return VISU::Result::_nil();
}
{
if (myStudyDocument->GetProperties()->IsLocked())
return Result::_nil();
- Mutex mt(myMutex);
- Result_i* pResult = Result_i::New(myStudyDocument,
+
+ Result_i* aResult = Result_i::New(myStudyDocument,
Result_i::eComponent,
Result_i::eImportMedField);
- if (pResult->Create(theField) != NULL) {
- return pResult->_this();
- } else {
- pResult->_remove_ref();
- return VISU::Result::_nil();
- }
+
+ if (aResult->Create(theField) != NULL)
+ return aResult->_this();
+ else
+ aResult->_remove_ref();
+
+ return VISU::Result::_nil();
}
void
theIteration)._retn();
}
+
+ //---------------------------------------------------------------
DeformedShape_ptr
VISU_Gen_i
::DeformedShapeOnField(Result_ptr theResult,
theIteration)._retn();
}
+
+ //---------------------------------------------------------------
ScalarMapOnDeformedShape_ptr
VISU_Gen_i
::ScalarMapOnDeformedShapeOnField(Result_ptr theResult,
theIteration)._retn();
}
+
+ //---------------------------------------------------------------
Vectors_ptr
VISU_Gen_i
::VectorsOnField(Result_ptr theResult,
theIteration)._retn();
}
+
+ //---------------------------------------------------------------
IsoSurfaces_ptr
VISU_Gen_i
::IsoSurfacesOnField(Result_ptr theResult,
theIteration)._retn();
}
+
+ //---------------------------------------------------------------
StreamLines_ptr
VISU_Gen_i
::StreamLinesOnField(Result_ptr theResult,
theIteration)._retn();
}
+
+ //---------------------------------------------------------------
Plot3D_ptr
VISU_Gen_i
::Plot3DOnField(Result_ptr theResult,
theIteration)._retn();
}
- CutPlanes_ptr VISU_Gen_i::CutPlanesOnField(Result_ptr theResult,
- const char* theMeshName,
- VISU::Entity theEntity,
- const char* theFieldName,
- CORBA::Long theIteration)
+
+ //---------------------------------------------------------------
+ CutPlanes_ptr
+ VISU_Gen_i
+ ::CutPlanesOnField(Result_ptr theResult,
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ CORBA::Long theIteration)
{
return Prs3dOnField<VISU::CutPlanes_i>(theResult,
theMeshName,
theIteration)._retn();
}
- CutLines_ptr VISU_Gen_i::CutLinesOnField(Result_ptr theResult,
- const char* theMeshName,
- VISU::Entity theEntity,
- const char* theFieldName,
- CORBA::Long theIteration)
+
+ //---------------------------------------------------------------
+ CutLines_ptr
+ VISU_Gen_i
+ ::CutLinesOnField(Result_ptr theResult,
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ CORBA::Long theIteration)
{
return Prs3dOnField<VISU::CutLines_i>(theResult,
theMeshName,
theIteration)._retn();
}
+
+ //---------------------------------------------------------------
struct CreateTableEvent: public SALOME_Event
{
SALOMEDS::Study_var myStudyDocument;
};
- Table_ptr VISU_Gen_i::CreateTable(const char* theTableEntry)
+ //---------------------------------------------------------------
+ Table_ptr
+ VISU_Gen_i
+ ::CreateTable(const char* theTableEntry)
{
if(myStudyDocument->GetProperties()->IsLocked())
return Table::_nil();
return ProcessEvent(new CreateTableEvent(myStudyDocument, theTableEntry));
}
- Curve_ptr VISU_Gen_i::CreateCurve(Table_ptr theTable,
- CORBA::Long theHRow,
- CORBA::Long theVRow)
+
+ //---------------------------------------------------------------
+ Curve_ptr
+ VISU_Gen_i
+ ::CreateCurve(Table_ptr theTable,
+ CORBA::Long theHRow,
+ CORBA::Long theVRow)
{
return CreateCurveWithZ( theTable, theHRow, theVRow, 0 );
}
- Curve_ptr VISU_Gen_i::CreateCurveWithZ(Table_ptr theTable,
- CORBA::Long theHRow,
- CORBA::Long theVRow,
- CORBA::Long theZRow)
+
+ //---------------------------------------------------------------
+ Curve_ptr
+ VISU_Gen_i
+ ::CreateCurveWithZ(Table_ptr theTable,
+ CORBA::Long theHRow,
+ CORBA::Long theVRow,
+ CORBA::Long theZRow)
{
if(myStudyDocument->GetProperties()->IsLocked())
return Curve::_nil();
}
}
- Container_ptr VISU_Gen_i::CreateContainer(){
+
+
+ //---------------------------------------------------------------
+ Container_ptr
+ VISU_Gen_i
+ ::CreateContainer()
+ {
if(myStudyDocument->GetProperties()->IsLocked())
return Container::_nil();
Mutex mt(myMutex);
}
}
- Animation_ptr VISU_Gen_i::CreateAnimation(View3D_ptr theView3D){
+
+ //---------------------------------------------------------------
+ Animation_ptr
+ VISU_Gen_i
+ ::CreateAnimation(View3D_ptr theView3D)
+ {
if(myStudyDocument->GetProperties()->IsLocked())
return Animation::_nil();
Mutex mt(myMutex);
return VISU::Animation::_nil();
}
- void VISU_Gen_i::DeleteResult (Result_ptr theResult)
+
+ //---------------------------------------------------------------
+ void
+ VISU_Gen_i
+ ::DeleteResult (Result_ptr theResult)
{
theResult->RemoveFromStudy();
}
- void VISU_Gen_i::DeletePrs3d (Prs3d_ptr thePrs3d)
+
+ //---------------------------------------------------------------
+ void
+ VISU_Gen_i
+ ::DeletePrs3d(Prs3d_ptr thePrs3d)
{
thePrs3d->RemoveFromStudy();
}
- void VISU_Gen_i::Close(SALOMEDS::SComponent_ptr theComponent){
- }
- char* VISU_Gen_i::ComponentDataType(){
+ //---------------------------------------------------------------
+ void
+ VISU_Gen_i
+ ::Close(SALOMEDS::SComponent_ptr theComponent)
+ {}
+
+
+ //---------------------------------------------------------------
+ char*
+ VISU_Gen_i
+ ::ComponentDataType()
+ {
return CORBA::string_dup("VISU");
}
- bool VISU_Gen_i::CanPublishInStudy(CORBA::Object_ptr theIOR) {
+
+ //---------------------------------------------------------------
+ bool
+ VISU_Gen_i
+ ::CanPublishInStudy(CORBA::Object_ptr theIOR)
+ {
Result_var aResultObj = Result::_narrow(theIOR);
return !(aResultObj->_is_nil());
}
- SALOMEDS::SObject_ptr VISU_Gen_i::PublishInStudy(SALOMEDS::Study_ptr theStudy,
- SALOMEDS::SObject_ptr theSObject,
- CORBA::Object_ptr theObject,
- const char* theName)
+
+ //---------------------------------------------------------------
+ SALOMEDS::SObject_ptr
+ VISU_Gen_i
+ ::PublishInStudy(SALOMEDS::Study_ptr theStudy,
+ SALOMEDS::SObject_ptr theSObject,
+ CORBA::Object_ptr theObject,
+ const char* theName)
throw (SALOME::SALOME_Exception)
{
Unexpect aCatch(SalomeException);
Mutex mt(myMutex);
SALOMEDS::SObject_var aResultSO;
Result_i* aResultObj = dynamic_cast<Result_i*>(GetServant(theObject).in());
- if (!aResultObj) return aResultSO._retn();
+ if (!aResultObj)
+ return aResultSO._retn();
const QFileInfo& aFileInfo = aResultObj->GetFileInfo();
CORBA::String_var anEntry = aResultObj->Create(aFileInfo.filePath().latin1())->GetID();
aResultSO = theStudy->FindObjectID(anEntry);
return aResultSO._retn();
}
- CORBA::Boolean VISU_Gen_i::CanCopy(SALOMEDS::SObject_ptr theObject) {
+
+ //---------------------------------------------------------------
+ CORBA::Boolean
+ VISU_Gen_i
+ ::CanCopy(SALOMEDS::SObject_ptr theObject)
+ {
Mutex mt(myMutex);
SALOMEDS::GenericAttribute_var anAttr;
if (!theObject->FindAttribute(anAttr, "AttributeIOR")) return false;
return false;
}
+
+ //---------------------------------------------------------------
SALOMEDS::TMPFile*
VISU_Gen_i
::CopyFrom(SALOMEDS::SObject_ptr theObject, CORBA::Long& theObjectID)
return aStreamFile._retn();
}
- CORBA::Boolean VISU_Gen_i::CanPaste(const char* theComponentName, CORBA::Long theObjectID) {
+
+ //---------------------------------------------------------------
+ CORBA::Boolean
+ 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 true;
}
- SALOMEDS::SObject_ptr VISU_Gen_i::PasteInto(const SALOMEDS::TMPFile& theStream,
- CORBA::Long theObjectID,
- SALOMEDS::SObject_ptr theObject)
+
+ //---------------------------------------------------------------
+ SALOMEDS::SObject_ptr
+ VISU_Gen_i
+ ::PasteInto(const SALOMEDS::TMPFile& theStream,
+ CORBA::Long theObjectID,
+ SALOMEDS::SObject_ptr theObject)
{
Mutex mt(myMutex);
SALOMEDS::SObject_var aResultSO;
return aResultSO._retn();
}
+
+ //---------------------------------------------------------------
VISU::ColoredPrs3dCache_ptr
- VISU_Gen_i::
- GetColoredPrs3dCache(SALOMEDS::Study_ptr theStudy)
+ VISU_Gen_i
+ ::GetColoredPrs3dCache(SALOMEDS::Study_ptr theStudy)
{
return ColoredPrs3dCache_i::GetInstance(theStudy);
}
void
BuildParts(Result_i* theResult,
Result_i::PInput theInput,
- const QFileInfo& theMPFileInfo,
+ const QFileInfo& theMultiFileInfo,
+ MultiResult_i::TPartInfos* thePartInfos,
MultiResult_i::TPartName2FileName* thePartName2FileName,
MultiResult_i::TPartName2ResolutionID* thePartName2ResolutionID,
CORBA::Boolean* theIsDone,
CORBA::Boolean theIsBuild,
- CORBA::Boolean theIsAtOnce,
_PTR(Study) theStudy)
{
if(!theIsBuild || *theIsDone)
// if MED file is not a distributed MED file (created with MULTIPR),
// then it is not necessary to build parts
- if (theMPFileInfo.filePath().isEmpty())
+ if (theMultiFileInfo.filePath().isEmpty())
return;
try {
multipr::Obj aMultiprObj;
- aMultiprObj.create(theMPFileInfo.filePath().latin1());
+ aMultiprObj.create(theMultiFileInfo.filePath().latin1());
if (aMultiprObj.isValidDistributedMEDFile()) {
const VISU::TMeshMap& aMeshMap = theInput->GetMeshMap();
VISU::TMeshMap::const_iterator aMeshMapIter = aMeshMap.begin();
aComment.latin1(),
false);
+ MultiResult_i::TPartInfos& myPartInfos = *thePartInfos;
MultiResult_i::TPartName2FileName& aPartName2FileName = *thePartName2FileName;
MultiResult_i::TPartName2ResolutionID& aPartName2ResolutionID = *thePartName2ResolutionID;
std::string aLastEntry;
for (size_t aPartID = 0 ; aPartID < aParts.size() ; aPartID++) {
const MultiResult_i::TPartName& aPartName = aParts[aPartID];
- std::string aPartInfo = aMultiprObj.getPartInfo(aPartName.c_str());
+ std::string aStringInfo = aMultiprObj.getPartInfo(aPartName.c_str());
- std::istrstream anOutputStream(aPartInfo.c_str());
- std::string aMeshName;
- anOutputStream>>aMeshName;
+ MultiResult_i::TPartInfo aPartInfo;
+ std::istrstream anOutputStream(aStringInfo.c_str());
+ anOutputStream>>(aPartInfo.myMeshName);
+ anOutputStream>>(aPartInfo.myPartID);
+ anOutputStream>>(aPartInfo.myName);
+ anOutputStream>>(aPartInfo.myPath);
+ anOutputStream>>(aPartInfo.myFileName);
- int anID;
- anOutputStream>>anID;
+ QFileInfo aFileInfo(aPartInfo.myFileName.c_str());
+ myPartInfos[aFileInfo.fileName()] = aPartInfo;
- std::string aName;
- anOutputStream>>aName;
-
- std::string aPath;
- anOutputStream>>aPath;
-
- std::string aFileName;
- anOutputStream>>aFileName;
-
- aPartName2FileName[aName] = aFileName;
+ aPartName2FileName[aPartInfo.myName] = aPartInfo.myFileName;
QString aComment = "";
- std::string aResoltutions = GetResolutions(aMain2SubParts, aName);
- if ( IsFullResolution(aName) ) {
- std::string anIconName = GetIconName(aMain2SubParts, aName);
- MultiResult_i::TResolutionID aResolutionID = GetResolutionID(aMain2SubParts, aName);
+ std::string aResoltutions = GetResolutions(aMain2SubParts, aPartInfo.myName);
+ if ( IsFullResolution(aPartInfo.myName) ) {
+ std::string anIconName = GetIconName(aMain2SubParts, aPartInfo.myName);
+ MultiResult_i::TResolutionID aResolutionID = GetResolutionID(aMain2SubParts, aPartInfo.myName);
aComment.sprintf("myComment=PART;myFile=%s;myResolutions=%s;myState=%c",
- aFileName.c_str(), aResoltutions.c_str(), aResolutionID);
+ aPartInfo.myFileName.c_str(), aResoltutions.c_str(), aResolutionID);
aLastEntry = CreateAttributes(theStudy,
aMesh->myPartsEntry,
anIconName,
NO_IOR,
- aName,
+ aPartInfo.myName,
NO_PERFSITENT_REF,
aComment.latin1(),
true);
- aPartName2ResolutionID[aName] = aResolutionID;
+ aPartName2ResolutionID[aPartInfo.myName] = aResolutionID;
} else {
aComment.sprintf("myComment=PART;myFile=%s;myResolutions=%s",
- aFileName.c_str(), aResoltutions.c_str());
+ aPartInfo.myFileName.c_str(), aResoltutions.c_str());
CreateAttributes(theStudy,
aLastEntry,
NO_ICON,
NO_IOR,
- aName,
+ aPartInfo.myName,
NO_PERFSITENT_REF,
aComment.latin1(),
true);
if(theIsAtOnce){
BuildParts(this,
GetInput(),
- myMPFileInfo,
+ myMultiFileInfo,
+ &myPartInfos,
&myPartName2FileName,
&myPartName2ResolutionID,
&myIsPartsDone,
myIsBuildParts,
- theIsAtOnce,
myStudy);
}
boost::thread aThread(boost::bind(&BuildParts,
this,
GetInput(),
- myMPFileInfo,
+ myMultiFileInfo,
+ &myPartInfos,
&myPartName2FileName,
&myPartName2ResolutionID,
&myIsPartsDone,
myIsBuildParts,
- false,
myStudy));
}
{
if (aSourceFileName.isEmpty())
throw std::runtime_error("distributed MED file; bad format");
- myMPFileInfo.setFile(theFileName);
+ myMultiFileInfo.setFile(theFileName);
aTargetFileName = aSourceFileName;
myIsBuildParts = true;
}
}
+//---------------------------------------------------------------
+void
+VISU::MultiResult_i
+::ToStream(std::ostringstream& theStr)
+{
+ TSuperClass::ToStream(theStr);
+
+ std::ostringstream aPartNames, aResolutions;
+ TPartName2ResolutionID::const_iterator anIter = myPartName2ResolutionID.begin();
+ for ( ; anIter != myPartName2ResolutionID.end() ; anIter++) {
+ const TPartName& aPartName = anIter->first;
+ aPartNames<<aPartName<<"|";
+ const TResolutionID& aResolution = anIter->second;
+ aResolutions<<aResolution<<"|";
+ }
+
+ Storable::DataToStream( theStr, "myPartNames", aPartNames.str().c_str());
+ if(MYDEBUG) MESSAGE("MultiResult_i::ToStream - aPartNames = "<<aPartNames.str());
+
+ Storable::DataToStream( theStr, "myResolutions", aResolutions.str().c_str());
+ if(MYDEBUG) MESSAGE("MultiResult_i::ToStream - aResolutions = "<<aResolutions.str());
+}
+
+
//---------------------------------------------------------------
VISU::Storable*
VISU::MultiResult_i
const Storable::TRestoringMap& theMap,
const string& thePrefix)
{
- return TSuperClass::Restore(theSObject,
- theMap,
- thePrefix);
+ if(!TSuperClass::Restore(theSObject, theMap, thePrefix))
+ return NULL;
+
+ QStringList aResolutions = QStringList::split("|", VISU::Storable::FindValue(theMap, "myResolutions"));
+ QStringList aPartNames = QStringList::split("|",VISU::Storable::FindValue(theMap, "myPartNames") );
+ for(size_t anId = 0, anEnd = aPartNames.size(); anId < anEnd; anId++){
+ const QString& aPartName = aPartNames[anId];
+ const QString& aResolution = aResolutions[anId];
+ if(MYDEBUG) MESSAGE("MultiResult_i::Restore - aPartName = '"<<aPartName<<"' = "<<aResolution);
+ myPartName2ResolutionID[aPartName.latin1()] = aResolution[0];
+ }
+
+ return this;
}
}
-//---------------------------------------------------------------
-void
-VISU::MultiResult_i
-::ToStream(std::ostringstream& theStr)
-{
- TSuperClass::ToStream(theStr);
-}
-
-
//---------------------------------------------------------------
VISU::MultiResult_i
::~MultiResult_i()