From c73e967de5cb2ad2ba94185d4cded74a7f622b2e Mon Sep 17 00:00:00 2001 From: smh Date: Wed, 28 Jan 2004 13:41:00 +0000 Subject: [PATCH] MPV: Merge V1.2d --- src/SMESHGUI/SMESHGUI_StudyAPI.cxx | 8 ++++---- src/SMESHGUI/SMESHGUI_Swig.cxx | 7 ++++--- src/SMESH_I/SMESH_Gen_i.cxx | 23 +++++++++++++---------- 3 files changed, 21 insertions(+), 17 deletions(-) diff --git a/src/SMESHGUI/SMESHGUI_StudyAPI.cxx b/src/SMESHGUI/SMESHGUI_StudyAPI.cxx index 6c5fdc5d6..42e2724d9 100644 --- a/src/SMESHGUI/SMESHGUI_StudyAPI.cxx +++ b/src/SMESHGUI/SMESHGUI_StudyAPI.cxx @@ -89,10 +89,10 @@ SMESHGUI_StudyAPI::SMESHGUI_StudyAPI ( SALOMEDS::Study_ptr aStudy, // NRI : Temporary added if ( myStudy->GetProperties()->IsLocked() ) { - QAD_MessageBox::warn1 ( (QWidget*)QAD_Application::getDesktop(), - QObject::tr("WARNING"), - QObject::tr("WRN_STUDY_LOCKED"), - QObject::tr("BUT_OK") ); +// QAD_MessageBox::warn1 ( (QWidget*)QAD_Application::getDesktop(), +// QObject::tr("WARNING"), +// QObject::tr("WRN_STUDY_LOCKED"), +// QObject::tr("BUT_OK") ); return; } diff --git a/src/SMESHGUI/SMESHGUI_Swig.cxx b/src/SMESHGUI/SMESHGUI_Swig.cxx index 67bdff519..2eace0798 100644 --- a/src/SMESHGUI/SMESHGUI_Swig.cxx +++ b/src/SMESHGUI/SMESHGUI_Swig.cxx @@ -91,6 +91,8 @@ void SMESH_Swig::Init(int studyID) SALOMEDS::SComponent_var father = myStudy->FindComponent("MESH"); if (father->_is_nil()) { + bool aLocked = myStudy->GetProperties()->IsLocked(); + if (aLocked) myStudy->GetProperties()->SetLocked(false); father = myStudyBuilder->NewComponent("MESH"); anAttr = myStudyBuilder->FindOrCreateAttribute(father, "AttributeName"); aName = SALOMEDS::AttributeName::_narrow(anAttr); @@ -99,10 +101,9 @@ void SMESH_Swig::Init(int studyID) anAttr = myStudyBuilder->FindOrCreateAttribute(father, "AttributePixMap"); aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr); aPixmap->SetPixMap( "ICON_OBJBROWSER_SMESH" ); + myStudyBuilder->DefineComponentInstance(father, CompMesh ); + if (aLocked) myStudy->GetProperties()->SetLocked(true); } - myStudyBuilder->DefineComponentInstance(father, CompMesh ); - mySComponentMesh = SALOMEDS::SComponent::_narrow( father ); - // Tags definition Tag_HypothesisRoot = 1; Tag_AlgorithmsRoot = 2; diff --git a/src/SMESH_I/SMESH_Gen_i.cxx b/src/SMESH_I/SMESH_Gen_i.cxx index d9c404cd9..b55ed358b 100644 --- a/src/SMESH_I/SMESH_Gen_i.cxx +++ b/src/SMESH_I/SMESH_Gen_i.cxx @@ -425,13 +425,13 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save(SALOMEDS::SComponent_ptr theComponent, SALOMEDS::ListOfFileNames_var aFileSeq = new SALOMEDS::ListOfFileNames; aFileSeq->length(NUM_TMP_FILES); - TCollection_AsciiString aStudyName(SALOMEDS_Tool::GetNameFromPath(theComponent->GetStudy()->URL())); + TCollection_AsciiString aStudyName(""); // Set names of temporary files - TCollection_AsciiString filename = aStudyName + TCollection_AsciiString("SMESH.hdf"); - TCollection_AsciiString hypofile = aStudyName + TCollection_AsciiString("SMESH_Hypo.txt"); - TCollection_AsciiString algofile = aStudyName + TCollection_AsciiString("SMESH_Algo.txt"); - TCollection_AsciiString meshfile = aStudyName + TCollection_AsciiString("SMESH_Mesh.med"); + TCollection_AsciiString filename = aStudyName + TCollection_AsciiString("_SMESH.hdf"); + TCollection_AsciiString hypofile = aStudyName + TCollection_AsciiString("_SMESH_Hypo.txt"); + TCollection_AsciiString algofile = aStudyName + TCollection_AsciiString("_SMESH_Algo.txt"); + TCollection_AsciiString meshfile = aStudyName + TCollection_AsciiString("_SMESH_Mesh.med"); aFileSeq[0] = CORBA::string_dup(filename.ToCString()); aFileSeq[1] = CORBA::string_dup(hypofile.ToCString()); aFileSeq[2] = CORBA::string_dup(algofile.ToCString()); @@ -848,7 +848,7 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save(SALOMEDS::SComponent_ptr theComponent, aStreamFile = SALOMEDS_Tool::PutFilesToStream(tmpDir.ToCString(), aFileSeq.in(), isMultiFile); // Remove temporary files and directory - if (isMultiFile) SALOMEDS_Tool::RemoveTemporaryFiles(tmpDir.ToCString(), aFileSeq.in(), true); + if (!isMultiFile) SALOMEDS_Tool::RemoveTemporaryFiles(tmpDir.ToCString(), aFileSeq.in(), true); MESSAGE("End SMESH_Gen_i::Save"); @@ -883,11 +883,14 @@ bool SMESH_Gen_i::Load(SALOMEDS::SComponent_ptr theComponent, tmpDir.ToCString(), isMultiFile); + TCollection_AsciiString aStudyName(""); + if (isMultiFile) aStudyName = (SALOMEDS_Tool::GetNameFromPath(theComponent->GetStudy()->URL())); + // Set names of temporary files - TCollection_AsciiString filename = tmpDir + aFileSeq[0];//"SMESH.hdf"; - TCollection_AsciiString hypofile = tmpDir + aFileSeq[1];//"SMESH_Hypo.txt"; - TCollection_AsciiString algofile = tmpDir + aFileSeq[2];//"SMESH_Algo.txt"; - TCollection_AsciiString meshfile = tmpDir + aFileSeq[3];//"SMESH_Mesh.med"; + TCollection_AsciiString filename = tmpDir + aStudyName + TCollection_AsciiString("_SMESH.hdf"); + TCollection_AsciiString hypofile = tmpDir + aStudyName + TCollection_AsciiString("_SMESH_Hypo.txt"); + TCollection_AsciiString algofile = tmpDir + aStudyName + TCollection_AsciiString("_SMESH_Algo.txt"); + TCollection_AsciiString meshfile = tmpDir + aStudyName + TCollection_AsciiString("_SMESH_Mesh.med"); SALOMEDS::Study_var Study = theComponent->GetStudy(); int studyId = Study->StudyId(); -- 2.39.2