Salome HOME
Multi-study removal completion rnv/multy_study_completion
authorrnv <rnv@opencascade.com>
Mon, 15 Apr 2019 11:09:23 +0000 (14:09 +0300)
committerrnv <rnv@opencascade.com>
Mon, 15 Apr 2019 11:09:23 +0000 (14:09 +0300)
src/SMESH_I/SMESH_Gen_i.cxx
src/SMESH_I/SMESH_Gen_i.hxx
src/SMESH_I/SMESH_PreMeshInfo.cxx
src/SMESH_I/SMESH_PreMeshInfo.hxx

index cf7d6a591fb9962d4894b18cf7a409d6e9fc157d..019fd5194a049578926c9db419eb02234b43f3ca 100644 (file)
@@ -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();
index f94e5395e9126670fcae2b0c0932457045222541..c451ee6b27dd1f13adc74f3ed3b13b41dc3f997a 100644 (file)
@@ -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();
index 58701b12364f4d179e4ece3be0b8763e77838e79..ec8424b25e6737cd75369c090252ffec2fedaff7 100644 (file)
@@ -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 );
index c78b946c7fbb819dacb5e65c217cacf61b8bd590..3721cf5233361306387b1f14ae0eaa3da7f2994a 100644 (file)
@@ -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: