-// Copyright (C) 2010-2015 CEA/DEN, EDF R&D
+// 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_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
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();
+ if ( app )
+ app->addPostRoutine(&PVViewer_ViewWindow::removePVMgr);
myPVMgr->setParent( this );
// This is mandatory, see setParent() method in Qt 4 documentation
myPVMgr->show();
setCentralWidget( myPVMgr );
-
- // Finish ParaView set up: behaviors, connection and configurations.
- const QString configPath(PVViewer_ViewManager::GetPVConfigPath());
- PVViewer_Core::ParaviewInitBehaviors(true, theDesktop);
- PVViewer_ViewManager::ConnectToExternalPVServer(theDesktop);
- PVViewer_Core::ParaviewLoadConfigurations(configPath);
-
// Hide toolbars
PVViewer_GUIElements * pvge = PVViewer_GUIElements::GetInstance(myDesktop);
pvge->setToolBarVisible(false);
}
}
+void PVViewer_ViewWindow::removePVMgr()
+{
+ pqTabbedMultiViewWidget* aPVMgr = qobject_cast<pqTabbedMultiViewWidget*>(pqApplicationCore::instance()->manager("MULTIVIEW_WIDGET"));
+ delete aPVMgr;
+}
+
/*!
\brief Get the visual parameters of the view window.
\return visual parameters of this view window formatted to the string
SUIT_ViewWindow::setVisualParameters( parameters );
}
-
/*!
\brief Returns the ParaView multi-view manager previously set with setMultiViewManager()
*/
{
return myPVMgr;
}
-
-//void PVViewer_ViewWindow::onEmulateApply()
-//{
-// emit this->applyRequest();
-//}