From: rnv Date: Mon, 15 Apr 2019 11:09:23 +0000 (+0300) Subject: Multi-study removal completion X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2Frnv%2Fmulty_study_completion;p=modules%2Fsmesh.git Multi-study removal completion --- diff --git a/src/SMESH_I/SMESH_Gen_i.cxx b/src/SMESH_I/SMESH_Gen_i.cxx index cf7d6a591..019fd5194 100644 --- a/src/SMESH_I/SMESH_Gen_i.cxx +++ b/src/SMESH_I/SMESH_Gen_i.cxx @@ -5908,7 +5908,7 @@ bool SMESH_Gen_i::LoadASCII( SALOMEDS::SComponent_ptr theComponent, */ //============================================================================= -void SMESH_Gen_i::Close( SALOMEDS::SComponent_ptr theComponent ) +void SMESH_Gen_i::Close() { if(MYDEBUG) MESSAGE( "SMESH_Gen_i::Close" ); @@ -5916,7 +5916,7 @@ void SMESH_Gen_i::Close( SALOMEDS::SComponent_ptr theComponent ) myStudyContext->Clear(); // remove the tmp files meshes are loaded from - SMESH_PreMeshInfo::RemoveStudyFiles_TMP_METHOD( theComponent ); + SMESH_PreMeshInfo::RemoveStudyFiles_TMP_METHOD(); // Clean trace of API methods calls CleanPythonTrace(); diff --git a/src/SMESH_I/SMESH_Gen_i.hxx b/src/SMESH_I/SMESH_Gen_i.hxx index f94e5395e..c451ee6b2 100644 --- a/src/SMESH_I/SMESH_Gen_i.hxx +++ b/src/SMESH_I/SMESH_Gen_i.hxx @@ -410,7 +410,7 @@ public: SMESH::Measurements_ptr CreateMeasurements(); // Clears study-connected data when it is closed - void Close( SALOMEDS::SComponent_ptr theComponent ); + void Close(); // Get component data type char* ComponentDataType(); diff --git a/src/SMESH_I/SMESH_PreMeshInfo.cxx b/src/SMESH_I/SMESH_PreMeshInfo.cxx index 58701b123..ec8424b25 100644 --- a/src/SMESH_I/SMESH_PreMeshInfo.cxx +++ b/src/SMESH_I/SMESH_PreMeshInfo.cxx @@ -1229,11 +1229,22 @@ bool SMESH_PreMeshInfo::IsMeshInfoCorrect() const */ //================================================================================ -void SMESH_PreMeshInfo::RemoveStudyFiles_TMP_METHOD(SALOMEDS::SComponent_ptr smeshComp) +void SMESH_PreMeshInfo::RemoveStudyFiles_TMP_METHOD() { if ( theMeshCounter > 0 ) { - SALOMEDS::ChildIterator_wrap itBig = SMESH_Gen_i::getStudyServant()->NewChildIterator( smeshComp ); + SMESH_Gen_i *aGen = SMESH_Gen_i::GetSMESHGen(); + if(!aGen) + return; + + SALOMEDS::Study_var aStudy = SMESH_Gen_i::getStudyServant(); + if(aStudy->_is_nil()) + return; + + CORBA::String_var compDataType = aGen->ComponentDataType(); + SALOMEDS::SObject_wrap aSO = aStudy->FindComponent( compDataType.in() ); + + SALOMEDS::ChildIterator_wrap itBig = SMESH_Gen_i::getStudyServant()->NewChildIterator( aSO ); for ( ; itBig->More(); itBig->Next() ) { SALOMEDS::SObject_wrap gotBranch = itBig->Value(); CORBA::Object_var anObject = SMESH_Gen_i::SObjectToObject( gotBranch ); diff --git a/src/SMESH_I/SMESH_PreMeshInfo.hxx b/src/SMESH_I/SMESH_PreMeshInfo.hxx index c78b946c7..3721cf523 100644 --- a/src/SMESH_I/SMESH_PreMeshInfo.hxx +++ b/src/SMESH_I/SMESH_PreMeshInfo.hxx @@ -87,7 +87,7 @@ public: // TEMPORARY method to remove study files on closing study; // RIGHT WAY: study files are remove automatically when meshes are destroyed - static void RemoveStudyFiles_TMP_METHOD(SALOMEDS::SComponent_ptr smeshComp); + static void RemoveStudyFiles_TMP_METHOD(); private: