From dab17831fa31ef8caa66ac3398321b94fd0b7af0 Mon Sep 17 00:00:00 2001 From: srn Date: Tue, 17 Oct 2006 10:37:39 +0000 Subject: [PATCH] IMP PAL13614: Replaced AttributeComment with AttributeString --- src/VISUGUI/VisuGUI.cxx | 12 ++++---- src/VISUGUI/VisuGUI_Module.cxx | 20 ++++++------- .../VisuGUI_ScalarMapOnDeformedShapeDlg.cxx | 10 +++---- src/VISUGUI/VisuGUI_Selection.cxx | 4 +-- src/VISUGUI/VisuGUI_StreamLinesDlg.cxx | 12 ++++---- src/VISUGUI/VisuGUI_Tools.cxx | 22 +++++++-------- src/VISU_I/VISUConfig.cc | 12 ++++---- src/VISU_I/VISU_DumpPython.cc | 18 ++++++------ src/VISU_I/VISU_Gen_i.cc | 28 +++++++++++++++---- src/VISU_I/VISU_Result_i.cc | 14 +++++----- src/VISU_I/VISU_Table_i.cc | 10 +++---- src/VISU_I/VISU_TimeAnimation.cxx | 22 +++++++-------- src/VISU_I/VISU_View_i.cc | 8 +++--- 13 files changed, 104 insertions(+), 88 deletions(-) diff --git a/src/VISUGUI/VisuGUI.cxx b/src/VISUGUI/VisuGUI.cxx index 64573fb3..aadd869d 100644 --- a/src/VISUGUI/VisuGUI.cxx +++ b/src/VISUGUI/VisuGUI.cxx @@ -1702,9 +1702,9 @@ OnShowAnimation() VISU::Storable::TRestoringMap aMap; _PTR(GenericAttribute) anAttr; - if (!aSObj->FindAttribute(anAttr, "AttributeComment")) return; + if (!aSObj->FindAttribute(anAttr, "AttributeString")) return; - _PTR(AttributeComment) aComment (anAttr); + _PTR(AttributeString) aComment (anAttr); string aComm = aComment->Value(); QString strIn (aComm.c_str()); VISU::Storable::StrToMap(strIn, aMap); @@ -2667,8 +2667,8 @@ void VisuGUI::contextMenuPopup( const QString& theClient, QPopupMenu* theMenu, Q CORBA::Object_var aCORBAObject = VISU::ClientSObjectToObject(aSObject); if (CORBA::is_nil(aCORBAObject)) { _PTR(GenericAttribute) anAttr; - if (aSObject->FindAttribute(anAttr, "AttributeComment")) { - _PTR(AttributeComment) aComment (anAttr); + if (aSObject->FindAttribute(anAttr, "AttributeString")) { + _PTR(AttributeString) aComment (anAttr); string aComm = aComment->Value(); QString strIn (aComm.c_str()); VISU::Storable::TRestoringMap pMap; @@ -2707,8 +2707,8 @@ void VisuGUI::contextMenuPopup( const QString& theClient, QPopupMenu* theMenu, Q if ( !aSObject ) continue; _PTR(GenericAttribute) anAttr; - if (aSObject->FindAttribute(anAttr, "AttributeComment")) { - _PTR(AttributeComment) aComment (anAttr); + if (aSObject->FindAttribute(anAttr, "AttributeString")) { + _PTR(AttributeString) aComment (anAttr); string aComm = aComment->Value(); QString strIn (aComm.c_str()); VISU::Storable::TRestoringMap pMap; diff --git a/src/VISUGUI/VisuGUI_Module.cxx b/src/VISUGUI/VisuGUI_Module.cxx index 3cab58e2..06beae6b 100644 --- a/src/VISUGUI/VisuGUI_Module.cxx +++ b/src/VISUGUI/VisuGUI_Module.cxx @@ -1315,8 +1315,8 @@ namespace Storable::DataToStream(aStream,"mySubId",theSelection.mySubId); _PTR(GenericAttribute) anAttr; - anAttr = theStudyBuilder->FindOrCreateAttribute(aNewObj,"AttributeComment"); - _PTR(AttributeComment) aComment(anAttr); + anAttr = theStudyBuilder->FindOrCreateAttribute(aNewObj,"AttributeString"); + _PTR(AttributeString) aComment(anAttr); aComment->SetValue(aStream.str()); } @@ -1346,8 +1346,8 @@ namespace // To update selection _PTR(GenericAttribute) anAttr; - if(aChildSObject->FindAttribute(anAttr,"AttributeComment")){ - _PTR(AttributeComment) aComment(anAttr); + if(aChildSObject->FindAttribute(anAttr,"AttributeString")){ + _PTR(AttributeString) aComment(anAttr); QString aStream(aComment->Value().c_str()); Storable::TRestoringMap aMap; @@ -1419,8 +1419,8 @@ namespace Handle(SALOME_InteractiveObject) anIO = aListIter.Value(); _PTR(SObject) aSObject = aCStudy->FindObjectID(anIO->getEntry()); _PTR(GenericAttribute) anAttr; - if(aSObject->FindAttribute(anAttr,"AttributeComment")){ - _PTR(AttributeComment) aComment(anAttr); + if(aSObject->FindAttribute(anAttr,"AttributeString")){ + _PTR(AttributeString) aComment(anAttr); std::string aCommentValue(aComment->Value()); if(aCommentValue.compare("myComment=GAUSSVIEW") >= 0){ aComment->SetValue(aValue.c_str()); @@ -1474,8 +1474,8 @@ namespace _PTR(Study) aCStudy = GetCStudy(GetAppStudy(theModule)); _PTR(GenericAttribute) anAttr; - if(theSObject->FindAttribute(anAttr,"AttributeComment")){ - _PTR(AttributeComment) aComment(anAttr); + if(theSObject->FindAttribute(anAttr,"AttributeString")){ + _PTR(AttributeString) aComment(anAttr); QString aStream(aComment->Value().c_str()); Storable::TRestoringMap aMap; Storable::StrToMap(aStream,aMap); @@ -1521,8 +1521,8 @@ OnRestoreConfiguration() _PTR(SObject) aSObject = aCStudy->FindObjectID(anIO->getEntry()); myConfigSObject = aSObject; _PTR(GenericAttribute) anAttr; - if(aSObject->FindAttribute(anAttr,"AttributeComment")){ - _PTR(AttributeComment) aComment(anAttr); + if(aSObject->FindAttribute(anAttr,"AttributeString")){ + _PTR(AttributeString) aComment(anAttr); QString aStream(aComment->Value().c_str()); Storable::TRestoringMap aMap; Storable::StrToMap(aStream,aMap); diff --git a/src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.cxx b/src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.cxx index b65bf0c2..b152a88d 100644 --- a/src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.cxx +++ b/src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.cxx @@ -47,7 +47,7 @@ #include "SALOME_ListIO.hxx" -#include "SALOMEDSClient_AttributeComment.hxx" +#include "SALOMEDSClient_AttributeString.hxx" #include "SALOMEDSClient_AttributeName.hxx" #include @@ -188,8 +188,8 @@ void VisuGUI_ScalarMapOnDeformedShapeDlg::initFromPrsObject _PTR(SObject) aSObject = aActiveStudy->FindObjectID(aIO->getEntry()); _PTR(GenericAttribute) anTmpAttr; - if (aSObject->FindAttribute(anTmpAttr, "AttributeComment")) { - _PTR(AttributeComment) aTmpComment (anTmpAttr); + if (aSObject->FindAttribute(anTmpAttr, "AttributeString")) { + _PTR(AttributeString) aTmpComment (anTmpAttr); string aTmpComm = aTmpComment->Value(); QString aTmpstrIn (aTmpComm.c_str()); VISU::Storable::TRestoringMap aTmpaMap; @@ -247,8 +247,8 @@ void VisuGUI_ScalarMapOnDeformedShapeDlg::initFromPrsObject CORBA::Object_var aChildObject = VISU::ClientSObjectToObject(aChildSObj); _PTR(GenericAttribute) anAttr; - if (aChildSObj->FindAttribute(anAttr, "AttributeComment")) { - _PTR(AttributeComment) aComment (anAttr); + if (aChildSObj->FindAttribute(anAttr, "AttributeString")) { + _PTR(AttributeString) aComment (anAttr); string aComm = aComment->Value(); QString strIn (aComm.c_str()); VISU::Storable::TRestoringMap aMap; diff --git a/src/VISUGUI/VisuGUI_Selection.cxx b/src/VISUGUI/VisuGUI_Selection.cxx index 6ddd429f..346deb29 100644 --- a/src/VISUGUI/VisuGUI_Selection.cxx +++ b/src/VISUGUI/VisuGUI_Selection.cxx @@ -397,8 +397,8 @@ void VisuGUI_SelectionDlg::onSelectionEvent() { VISU::Storable::TRestoringMap aMap; if (aSObject) { _PTR(GenericAttribute) anAttr; - if (aSObject->FindAttribute(anAttr, "AttributeComment")) { - _PTR(AttributeComment) aComment (anAttr); + if (aSObject->FindAttribute(anAttr, "AttributeString")) { + _PTR(AttributeString) aComment (anAttr); std::string aString = aComment->Value(); QString strIn( aString.c_str() ); VISU::Storable::StrToMap(strIn, aMap); diff --git a/src/VISUGUI/VisuGUI_StreamLinesDlg.cxx b/src/VISUGUI/VisuGUI_StreamLinesDlg.cxx index 7a1820c1..1f59da7e 100644 --- a/src/VISUGUI/VisuGUI_StreamLinesDlg.cxx +++ b/src/VISUGUI/VisuGUI_StreamLinesDlg.cxx @@ -108,8 +108,8 @@ VisuGUI_StreamLinesDlg::VisuGUI_StreamLinesDlg (SalomeApp_Module* theModule) _PTR(SObject) aSObject = aActiveStudy->FindObjectID(aIO->getEntry()); _PTR(GenericAttribute) anTmpAttr; - if (aSObject->FindAttribute(anTmpAttr, "AttributeComment")) { - _PTR(AttributeComment) aTmpComment (anTmpAttr); + if (aSObject->FindAttribute(anTmpAttr, "AttributeString")) { + _PTR(AttributeString) aTmpComment (anTmpAttr); string aTmpComm = aTmpComment->Value(); QString aTmpstrIn (aTmpComm.c_str()); VISU::Storable::TRestoringMap aTmpaMap; @@ -183,8 +183,8 @@ VisuGUI_StreamLinesDlg::VisuGUI_StreamLinesDlg (SalomeApp_Module* theModule) } _PTR(GenericAttribute) anAttr; - if (aChildSObj->FindAttribute(anAttr, "AttributeComment")) { - _PTR(AttributeComment) aComment (anAttr); + if (aChildSObj->FindAttribute(anAttr, "AttributeString")) { + _PTR(AttributeString) aComment (anAttr); string aComm = aComment->Value(); QString strIn (aComm.c_str()); VISU::Storable::TRestoringMap aMap; @@ -539,8 +539,8 @@ VISU::Mesh_ptr VisuGUI_StreamLinesDlg::createMesh (VISU::VISUType theType, QStri for (aIter->InitEx(true); aIter->More(); aIter->Next() ) { SALOMEDSClient_SObject* aChildSObj = aIter->Value(); SALOMEDSClient_GenericAttribute* anAttr; - if (aChildSObj->FindAttribute(anAttr, "AttributeComment")) { - SALOMEDSClient_AttributeComment* aComment = dynamic_cast( anAttr ); + if (aChildSObj->FindAttribute(anAttr, "AttributeString")) { + SALOMEDSClient_AttributeString* aComment = dynamic_cast( anAttr ); CORBA::String_var aComm = aComment->Value().c_str(); QString strIn(aComm.in()); aMap.clear(); diff --git a/src/VISUGUI/VisuGUI_Tools.cxx b/src/VISUGUI/VisuGUI_Tools.cxx index f9ea32df..1ffbc399 100644 --- a/src/VISUGUI/VisuGUI_Tools.cxx +++ b/src/VISUGUI/VisuGUI_Tools.cxx @@ -224,8 +224,8 @@ namespace VISU VISU::Storable::TRestoringMap aMap; if (theSObject) { _PTR(GenericAttribute) anAttr; - if (theSObject->FindAttribute(anAttr, "AttributeComment")) { - _PTR(AttributeComment) aComment (anAttr); + if (theSObject->FindAttribute(anAttr, "AttributeString")) { + _PTR(AttributeString) aComment (anAttr); std::string aValue = aComment->Value(); QString aString (aValue.c_str()); VISU::Storable::StrToMap(aString, aMap); @@ -257,8 +257,8 @@ namespace VISU _PTR(SObject) aSObject = aStudy->FindObjectID(theEntry.latin1()); if (aSObject) { _PTR(GenericAttribute) anAttr; - if (theMap && aSObject->FindAttribute(anAttr,"AttributeComment")) { - _PTR(AttributeComment) aComment (anAttr); + if (theMap && aSObject->FindAttribute(anAttr,"AttributeString")) { + _PTR(AttributeString) aComment (anAttr); std::string aValue = aComment->Value(); QString aString (aValue.c_str()); VISU::Storable::StrToMap(aString, *theMap); @@ -388,12 +388,12 @@ namespace VISU // (first sub-level) or is a child of such an object string aNAME, aVisuNAME = GetVisuGen(theModule)->ComponentDataType(); _PTR(GenericAttribute) anAttr; - _PTR(AttributeComment) aComment; + _PTR(AttributeString) aComment; bool isUnderVISU = false; _PTR(SObject) aFatherSObject = aSObject->GetFather(); - if (aFatherSObject->FindAttribute(anAttr, "AttributeComment")) { - _PTR(AttributeComment) aComment (anAttr); + if (aFatherSObject->FindAttribute(anAttr, "AttributeString")) { + _PTR(AttributeString) aComment (anAttr); aNAME = aComment->Value(); if (aNAME == aVisuNAME) { isUnderVISU = true; @@ -409,8 +409,8 @@ namespace VISU isUnderVISU = false; aFatherSObject = aFatherSObject->GetFather(); - if (aFatherSObject->FindAttribute(anAttr, "AttributeComment")) { - _PTR(AttributeComment) aComment (anAttr); + if (aFatherSObject->FindAttribute(anAttr, "AttributeString")) { + _PTR(AttributeString) aComment (anAttr); aNAME = aComment->Value(); if (aNAME == aVisuNAME) { isUnderVISU = true; @@ -1199,8 +1199,8 @@ namespace VISU } } else { _PTR(GenericAttribute) anAttr; - if (theObject->FindAttribute(anAttr, "AttributeComment")) { - _PTR(AttributeComment) aComment (anAttr); + if (theObject->FindAttribute(anAttr, "AttributeString")) { + _PTR(AttributeString) aComment (anAttr); string aComm = aComment->Value(); QString strIn (aComm.c_str()); VISU::Storable::TRestoringMap pMap; diff --git a/src/VISU_I/VISUConfig.cc b/src/VISU_I/VISUConfig.cc index 72c1635d..6d5618c9 100644 --- a/src/VISU_I/VISUConfig.cc +++ b/src/VISU_I/VISUConfig.cc @@ -265,8 +265,8 @@ namespace VISU{ SALOMEDS::SObject_var aFieldSO; for(;anIter->More();anIter->Next()) { SALOMEDS::GenericAttribute_var anAttr; - if (anIter->Value()->FindAttribute(anAttr,"AttributeComment")) { - SALOMEDS::AttributeComment_var aCmnt = SALOMEDS::AttributeComment::_narrow(anAttr); + if (anIter->Value()->FindAttribute(anAttr,"AttributeString")) { + SALOMEDS::AttributeString_var aCmnt = SALOMEDS::AttributeString::_narrow(anAttr); CORBA::String_var aString = aCmnt->Value(); string aValue(aString); if (aValue == theComment) { @@ -308,8 +308,8 @@ namespace VISU{ aPRef->SetValue(thePersistentRef); } if(strcmp(theComment,"") != 0){ - anAttr = aStudyBuilder->FindOrCreateAttribute(newObj, "AttributeComment"); - SALOMEDS::AttributeComment_var aCmnt = SALOMEDS::AttributeComment::_narrow(anAttr); + anAttr = aStudyBuilder->FindOrCreateAttribute(newObj, "AttributeString"); + SALOMEDS::AttributeString_var aCmnt = SALOMEDS::AttributeString::_narrow(anAttr); aCmnt->SetValue(theComment); if(MYDEBUG) INFOS("CreateAttributes - Comment = "<SetValue(thePersistentRef); } if (strcmp(theComment, "") != 0) { - anAttr = aStudyBuilder->FindOrCreateAttribute(newObj, "AttributeComment"); - _PTR(AttributeComment) aCmnt (anAttr); + anAttr = aStudyBuilder->FindOrCreateAttribute(newObj, "AttributeString"); + _PTR(AttributeString) aCmnt (anAttr); aCmnt->SetValue(theComment); if (MYDEBUG) INFOS("CreateAttributes - Comment = " << theComment); } diff --git a/src/VISU_I/VISU_DumpPython.cc b/src/VISU_I/VISU_DumpPython.cc index a5378c0a..6b839711 100644 --- a/src/VISU_I/VISU_DumpPython.cc +++ b/src/VISU_I/VISU_DumpPython.cc @@ -299,9 +299,9 @@ namespace VISU { SALOMEDS::GenericAttribute_var anAttr; SALOMEDS::SObject_var aFatherSObject = theSObject->GetFather(); - if(aFatherSObject->FindAttribute(anAttr,"AttributeComment")){ - SALOMEDS::AttributeComment_var aComment = - SALOMEDS::AttributeComment::_narrow(anAttr); + if(aFatherSObject->FindAttribute(anAttr,"AttributeString")){ + SALOMEDS::AttributeString_var aComment = + SALOMEDS::AttributeString::_narrow(anAttr); CORBA::String_var aValue = aComment->Value(); Storable::TRestoringMap aMap; Storable::StrToMap(aValue.in(),aMap); @@ -1013,9 +1013,9 @@ namespace VISU case VISU::TTABLE: if(dynamic_cast(GetServant(anObj).in())){ SALOMEDS::GenericAttribute_var anAttr; - if(theSObject->FindAttribute(anAttr,"AttributeComment")){ + if(theSObject->FindAttribute(anAttr,"AttributeString")){ using namespace SALOMEDS; - AttributeComment_var aComment = AttributeComment::_narrow(anAttr); + AttributeString_var aComment = AttributeString::_narrow(anAttr); CORBA::String_var aValue = aComment->Value(); Storable::TRestoringMap aMap; Storable::StrToMap(aValue.in(),aMap); @@ -1100,9 +1100,9 @@ namespace VISU } } else { /*if(!CORBA::is_nil(anObj))*/ SALOMEDS::GenericAttribute_var anAttr; - if (theSObject->FindAttribute(anAttr,"AttributeComment")) { - SALOMEDS::AttributeComment_var aComment = - SALOMEDS::AttributeComment::_narrow(anAttr); + if (theSObject->FindAttribute(anAttr,"AttributeString")) { + SALOMEDS::AttributeString_var aComment = + SALOMEDS::AttributeString::_narrow(anAttr); CORBA::String_var aValue = aComment->Value(); Storable::TRestoringMap aMap; Storable::StrToMap(aValue.in(),aMap); @@ -1141,7 +1141,7 @@ namespace VISU theStr<FindAttribute(anAttr, "AttributeComment") ) { - SALOMEDS::AttributeComment_var aAttComment = SALOMEDS::AttributeComment::_narrow(anAttr); + bool isAttrStringFound = false; + + if( theSObject->FindAttribute(anAttr, "AttributeComment") ) { + //SRN: Replace an AttributeComment with AttributeString + SALOMEDS::AttributeComment_var aComment = SALOMEDS::AttributeComment::_narrow(anAttr); + string aValue = aComment->Value(); + theBuilder->RemoveAttribute(theSObject, "AttributeComment"); + anAttr = theBuilder->FindOrCreateAttribute(theSObject, "AttributeString"); + SALOMEDS::AttributeString_var aStringAttr = SALOMEDS::AttributeString::_narrow(anAttr); + aStringAttr->SetValue(aValue.c_str()); + isAttrStringFound = true; + + } + + if ( isAttrStringFound || theSObject->FindAttribute(anAttr, "AttributeString") ) { + SALOMEDS::AttributeString_var aAttComment = SALOMEDS::AttributeString::_narrow(anAttr); if ( aAttComment ) { string aValue = aAttComment->Value(); if ( aValue.compare("") ) { @@ -360,12 +374,14 @@ namespace VISU SALOMEDS::Study_var aStudy = theComponent->GetStudy(); SALOMEDS::ChildIterator_var anIter = aStudy->NewChildIterator(theComponent); + SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder(); + for (anIter->InitEx(true); anIter->More(); anIter->Next()) { SALOMEDS::SObject_var aSObject = anIter->Value(); - CorrectSObjectType(aSObject); + CorrectSObjectType(aSObject, aStudyBuilder); } - SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder(); + string aDir = isMultiFile ? theURL : SALOMEDS_Tool::GetTmpDir(); TCollection_AsciiString aTmpDir (const_cast(aDir.c_str())); VisuTmpDir = aTmpDir.ToCString(); @@ -1173,7 +1189,7 @@ namespace VISU aResultSO = SALOMEDS::SObject::_duplicate(theObject); //Just for Result::Restore to find the Comment attribute :( - SALOMEDS::GenericAttribute_var anAttr = aStudyBuilder->FindOrCreateAttribute(aResultSO, "AttributeComment"); + SALOMEDS::GenericAttribute_var anAttr = aStudyBuilder->FindOrCreateAttribute(aResultSO, "AttributeString"); Storable* aStorable = Storable::Create(aResultSO,aFileName,aString); diff --git a/src/VISU_I/VISU_Result_i.cc b/src/VISU_I/VISU_Result_i.cc index db7457fb..77871bc1 100644 --- a/src/VISU_I/VISU_Result_i.cc +++ b/src/VISU_I/VISU_Result_i.cc @@ -247,8 +247,8 @@ namespace VISU aName->SetValue(theName); } if (theComment != "") { - anAttr = aStudyBuilder->FindOrCreateAttribute(aNewObj, "AttributeComment"); - _PTR(AttributeComment) aCmnt (anAttr); + anAttr = aStudyBuilder->FindOrCreateAttribute(aNewObj, "AttributeString"); + _PTR(AttributeString) aCmnt (anAttr); aCmnt->SetValue(theComment); } return aNewObj->GetID(); @@ -281,8 +281,8 @@ namespace VISU aName->SetValue(theName); } if (theComment != "") { - anAttr = aStudyBuilder->FindOrCreateAttribute(aSObject, "AttributeComment"); - _PTR(AttributeComment) aCmnt (anAttr); + anAttr = aStudyBuilder->FindOrCreateAttribute(aSObject, "AttributeString"); + _PTR(AttributeString) aCmnt (anAttr); aCmnt->SetValue(theComment); } } @@ -1365,9 +1365,9 @@ Restore(SALOMEDS::SObject_ptr theSObject, GetComment(), VISU::TRESULT, myFileInfo.filePath().latin1(), myInitFileName.c_str()); // Restoring of Python dump SALOMEDS::GenericAttribute_var anAttr; - if (!theSObject->FindAttribute(anAttr, "AttributeComment")) - throw std::runtime_error("Build - There is no AttributeComment for the SObject !!!"); - SALOMEDS::AttributeComment_var aCmnt = SALOMEDS::AttributeComment::_narrow(anAttr); + if (!theSObject->FindAttribute(anAttr, "AttributeString")) + throw std::runtime_error("Build - There is no AttributeString for the SObject !!!"); + SALOMEDS::AttributeString_var aCmnt = SALOMEDS::AttributeString::_narrow(anAttr); aCmnt->SetValue(aComment.latin1()); } bool anIsBuildAll = VISU::GetResourceMgr()->booleanValue("VISU", "full_med_loading", false); diff --git a/src/VISU_I/VISU_Table_i.cc b/src/VISU_I/VISU_Table_i.cc index cb642126..899595bd 100644 --- a/src/VISU_I/VISU_Table_i.cc +++ b/src/VISU_I/VISU_Table_i.cc @@ -180,9 +180,9 @@ VISU::Storable* VISU::Table_i::Build( int theRestoring ) else{ aComment.sprintf("myComment=%s;myType=%d;mySourceId=TableAttr",GetComment(),VISU::TTABLE); SALOMEDS::SObject_var aFatherSObject = SO->GetFather(); - if(aFatherSObject->FindAttribute(anAttr,"AttributeComment")){ - SALOMEDS::AttributeComment_var aCommentAttr = - SALOMEDS::AttributeComment::_narrow(anAttr); + if(aFatherSObject->FindAttribute(anAttr,"AttributeString")){ + SALOMEDS::AttributeString_var aCommentAttr = + SALOMEDS::AttributeString::_narrow(anAttr); CORBA::String_var aValue = aCommentAttr->Value(); Storable::TRestoringMap aMap; Storable::StrToMap(aValue.in(),aMap); @@ -1248,8 +1248,8 @@ SALOMEDS::SObject_var VISU::ImportTables(const char* theFileName, SALOMEDS::Stud SALOMEDS::AttributeName_var aName = SALOMEDS::AttributeName::_narrow(anAttr); QFileInfo aFileInfo(theFileName); aName->SetValue(aFileInfo.fileName().latin1()); - anAttr = aStudyBuilder->FindOrCreateAttribute(aFileObject, "AttributeComment"); - SALOMEDS::AttributeComment_var aComment = SALOMEDS::AttributeComment::_narrow(anAttr); + anAttr = aStudyBuilder->FindOrCreateAttribute(aFileObject, "AttributeString"); + SALOMEDS::AttributeString_var aComment = SALOMEDS::AttributeString::_narrow(anAttr); QString aString; aString.sprintf("myComment=ImportTables;myFileName=%s", aFileInfo.absFilePath().latin1()); diff --git a/src/VISU_I/VISU_TimeAnimation.cxx b/src/VISU_I/VISU_TimeAnimation.cxx index 5faacca8..92f1ea7d 100644 --- a/src/VISU_I/VISU_TimeAnimation.cxx +++ b/src/VISU_I/VISU_TimeAnimation.cxx @@ -55,7 +55,7 @@ #include "SUIT_Session.h" #include "SUIT_Study.h" -#include "SALOMEDSClient_AttributeComment.hxx" +#include "SALOMEDSClient_AttributeString.hxx" #include "SALOMEDSClient_AttributeName.hxx" #include @@ -823,8 +823,8 @@ VISU::Storable::TRestoringMap VISU_TimeAnimation::getMapOfValue (_PTR(SObject) t VISU::Storable::TRestoringMap aMap; if (theSObject) { _PTR(GenericAttribute) anAttr; - if (theSObject->FindAttribute(anAttr, "AttributeComment")) { - _PTR(AttributeComment) aComment (anAttr); + if (theSObject->FindAttribute(anAttr, "AttributeString")) { + _PTR(AttributeString) aComment (anAttr); std::string aString = aComment->Value(); QString strIn (aString.c_str()); VISU::Storable::StrToMap(strIn, aMap); @@ -990,8 +990,8 @@ void VISU_TimeAnimation::saveAnimation() VISU::TANIMATION,myTimeMinVal,myTimeMaxVal); _PTR(GenericAttribute) anAttr; - anAttr = aStudyBuilder->FindOrCreateAttribute(aAnimSObject, "AttributeComment"); - _PTR(AttributeComment) aCmnt (anAttr); + anAttr = aStudyBuilder->FindOrCreateAttribute(aAnimSObject, "AttributeString"); + _PTR(AttributeString) aCmnt (anAttr); aCmnt->SetValue(aComment.latin1()); _PTR(ChildIterator) anIter = myStudy->NewChildIterator(aAnimSObject); @@ -1016,8 +1016,8 @@ void VISU_TimeAnimation::saveAnimation() if (anPrsIter->More()) { _PTR(SObject) aPrsObj = anPrsIter->Value(); - anAttr = aStudyBuilder->FindOrCreateAttribute(aPrsObj, "AttributeComment"); - aCmnt = _PTR(AttributeComment)(anAttr); + anAttr = aStudyBuilder->FindOrCreateAttribute(aPrsObj, "AttributeString"); + aCmnt = _PTR(AttributeString)(anAttr); aCmnt->SetValue(aPrsComment.c_str()); anAttr = aStudyBuilder->FindOrCreateAttribute(aPrsObj, "AttributeName"); @@ -1045,9 +1045,9 @@ void VISU_TimeAnimation::restoreFromStudy(_PTR(SObject) theField) VISU::Storable::TRestoringMap aMap; _PTR(GenericAttribute) anAttr; - if (!aAnimSObject->FindAttribute(anAttr, "AttributeComment")) return; + if (!aAnimSObject->FindAttribute(anAttr, "AttributeString")) return; - _PTR(AttributeComment) aComment (anAttr); + _PTR(AttributeString) aComment (anAttr); string aComm = aComment->Value(); QString strIn (aComm.c_str()); VISU::Storable::StrToMap(strIn,aMap); @@ -1098,8 +1098,8 @@ void VISU_TimeAnimation::restoreFromStudy(_PTR(SObject) theField) continue; generatePresentations(getNbFields()-1); - if (!aPrsObj->FindAttribute(anAttr, "AttributeComment")) continue; - _PTR(AttributeComment) aPrsComment (anAttr); + if (!aPrsObj->FindAttribute(anAttr, "AttributeString")) continue; + _PTR(AttributeString) aPrsComment (anAttr); string aPrsComm = aPrsComment->Value(); if (aPrsComm.length() > 0) { QString strPrsIn (aPrsComm.c_str()); diff --git a/src/VISU_I/VISU_View_i.cc b/src/VISU_I/VISU_View_i.cc index abb6ad9b..1c6e4682 100644 --- a/src/VISU_I/VISU_View_i.cc +++ b/src/VISU_I/VISU_View_i.cc @@ -1610,8 +1610,8 @@ namespace VISU { _PTR(SObject) anObj = aList[i]; string anEntry = anObj->GetID(); if(MYDEBUG) MESSAGE("View3D_i::SaveViewParams - anEntry = " << anEntry); - if (anObj->FindAttribute(anAttr, "AttributeComment")) { - _PTR(AttributeComment) aCmnt (anAttr); + if (anObj->FindAttribute(anAttr, "AttributeString")) { + _PTR(AttributeString) aCmnt (anAttr); string aComm (aCmnt->Value()); if (MYDEBUG) MESSAGE("View3D_i::SaveViewPoint - aComm = " << aComm); if (aComm.compare(View3D_i::myComment) >= 0) { @@ -1671,8 +1671,8 @@ namespace VISU { _PTR(SObject) anObj = aList[i]; string anEntry = anObj->GetID(); if (MYDEBUG) MESSAGE("View3D_i::RestoreViewPoint - anEntry = " << anEntry); - if (anObj->FindAttribute(anAttr, "AttributeComment")) { - _PTR(AttributeComment) aCmnt (anAttr); + if (anObj->FindAttribute(anAttr, "AttributeString")) { + _PTR(AttributeString) aCmnt (anAttr); QString strIn(aCmnt->Value().c_str()); Storable::TRestoringMap aMap; Storable::StrToMap(strIn, aMap); -- 2.39.2