Salome HOME
bos #30440 [CEA 30439] new salome doesn't clean paraview view in FIELDS V9_9_1_BR V9_9_1b1
authorViktor Uzlov <viktor.uzlov@opencascade.com>
Mon, 18 Jul 2022 07:17:31 +0000 (10:17 +0300)
committerrnv <rnv@opencascade.com>
Mon, 18 Jul 2022 13:40:14 +0000 (16:40 +0300)
src/MEDCalc/gui/MEDModule.cxx
src/MEDCalc/gui/MEDModule.hxx
src/MEDCalc/gui/PresentationController.cxx
src/MEDCalc/gui/PresentationController.hxx

index 3abeeb69d9960d3d04e27df5062fe3678d733d93..0042ad52d266f3c348a4f9b7fa189b7d022f5db7 100644 (file)
@@ -313,6 +313,14 @@ MEDModule::deactivateModule( SUIT_Study* theStudy )
   return SalomeApp_Module::deactivateModule( theStudy );
 }
 
+void MEDModule::studyClosed(SUIT_Study* study)
+{
+  STDLOG("MEDModule::studyClosed()");
+  _presentationController->resetPVSession();
+
+  SalomeApp_Module::studyClosed(study);
+}
+
 //
 // =====================================================================
 // This part add custom widgets (a dockwidget containing a tree view
index 832bd66b86a009e2e9541777c14072ab3ebb793a..af08df25b8d36fd58da4de55427327612a0555e0 100644 (file)
@@ -109,6 +109,7 @@ signals:
 public slots:
   virtual bool activateModule(SUIT_Study* theStudy);
   virtual bool deactivateModule(SUIT_Study* theStudy);
+  virtual void studyClosed( SUIT_Study* theStudy);
   virtual void onDblClick(const QModelIndex& index);
   virtual void onClick(const QModelIndex& index);
 
index 9ce5b777cdebd64e3b79eccced69ec7d2c5d3127..c7f12753e87a612073cdf2b3d698d5f5e97b68bf 100644 (file)
@@ -1011,4 +1011,11 @@ void PresentationController::updateVisibilityState(long presId)
 
 std::string PresentationController::presentationName2Type(const std::string& name) {
   return std::regex_replace(name, std::regex("MEDPresentation"), std::string(""));
-}
\ No newline at end of file
+}
+
+void PresentationController::resetPVSession()
+{
+  QStringList commands;
+  commands += QString("pvs.ResetSession()");
+  _consoleDriver->exec(commands);
+}
index f65b8b9fba7572eb1705e474b4c229522185797c..5635a350450f3e531efe64950db67b819a3f0981 100644 (file)
@@ -62,6 +62,8 @@ public:
 
   void emitPresentationSignal(const PresentationEvent* event);
 
+  void resetPVSession();
+
 signals:
   void presentationSignal(const PresentationEvent*);