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 f2c7f9221c048da06bdcdf2fc62057efec6d88ec..a724de9b834b30ed894b4cbaf04cba054a404f3d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2016  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
 #include "PVViewer_GUIElements.h"
 #include "PVViewer_ViewManager.h"
 
-#include <SUIT_ViewManager.h>
-#include <SUIT_ResourceMgr.h>
-#include <SUIT_Session.h>
-#include <SUIT_Desktop.h>
-#include <SUIT_Application.h>
+#include "SUIT_ViewManager.h"
+#include "SUIT_ResourceMgr.h"
+#include "SUIT_Session.h"
+#include "SUIT_Desktop.h"
+#include "SUIT_Application.h"
 
 #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()
 */
@@ -117,8 +121,3 @@ pqTabbedMultiViewWidget* PVViewer_ViewWindow::getMultiViewManager() const
 {
   return myPVMgr;
 }
-
-//void PVViewer_ViewWindow::onEmulateApply()
-//{
-//  emit this->applyRequest();
-//}