Salome HOME
Make the PVViewer active again at ParaVIS activation to avoid a new RenderView being...
[modules/gui.git] / src / PVViewer / PVViewer_ViewWindow.cxx
index 4f792e8098c5885bd5764312f6d8cd3e98b1fb65..a724de9b834b30ed894b4cbaf04cba054a404f3d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2020  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2022  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -32,7 +32,7 @@
 
 #include <pqTabbedMultiViewWidget.h>
 #include <pqApplicationCore.h>
-
+#include "pqActiveObjects.h"
 
 /*!
   \class PVViewer_ViewWindow
@@ -50,6 +50,11 @@ PVViewer_ViewWindow::PVViewer_ViewWindow( SUIT_Desktop* theDesktop, PVViewer_Vie
   myDesktop = theDesktop;
   myModel = theModel;
   setViewManager(myModel->getViewManager());
+  // This may improve synchronization between PV3DViewer and PVViewer
+  // but this make the PVViewer not active when ParaVIS is launched,
+  // which results in a new RenderView being created when a dataset is displayed.
+  // So we comment it for now.
+  //pqActiveObjects::instance().setActiveView(nullptr);
   myPVMgr = qobject_cast<pqTabbedMultiViewWidget*>(pqApplicationCore::instance()->manager("MULTIVIEW_WIDGET"));
   if (myPVMgr) {
     SUIT_Application* app = SUIT_Session::session()->activeApplication();
@@ -109,7 +114,6 @@ void PVViewer_ViewWindow::setVisualParameters( const QString& parameters )
   SUIT_ViewWindow::setVisualParameters( parameters );
 }
 
-
 /*!
   \brief Returns the ParaView multi-view manager previously set with setMultiViewManager()
 */