-// Copyright (C) 2014-2016 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2024 CEA, EDF, 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 <pqServerResource.h>
#include <pqSetName.h>
#include <pqVCRToolbar.h>
+#include <pqPipelineSource.h>
+
+#include <vtkSMSessionProxyManager.h>
+#include <vtkSMProxyIterator.h>
+
+#include <vtkPVConfig.h>
#include <QAction>
#include <QCoreApplication>
#include <QMenu>
#include <QToolBar>
-
PVViewer_GUIElements * PVViewer_GUIElements::theInstance = 0;
-PVViewer_GUIElements::PVViewer_GUIElements(QMainWindow* desk) :
- myDesktop(desk),
+PVViewer_GUIElements::PVViewer_GUIElements(QMainWindow* desktop) :
propertiesPanel(0),
pipelineBrowserWidget(0),
+ pipelineModel(0),
sourcesMenu(0),
filtersMenu(0),
macrosMenu(0),
- myPVWidgetsFlag(false)
+ catalystMenu(0),
+ mainToolBar(0),
+ vcrToolbar(0),
+ timeToolbar(0),
+ colorToolbar(0),
+ reprToolbar(0),
+ cameraToolbar(0),
+ axesToolbar(0),
+ macrosToolbar(0),
+ commonToolbar(0),
+ dataToolbar(0),
+ myDesktop(desktop),
+ myPVWidgetsFlag(false),
+ mainAction(0),
+ vcrAction(0),
+ timeAction(0),
+ colorAction(0),
+ reprAction(0),
+ cameraAction(0),
+ axesAction(0),
+ macrosAction(0),
+ commonAction(0),
+ dataAction(0)
{
}
//Pipeline Browser
if ( !pipelineBrowserWidget ) {
- pipelineBrowserWidget = new pqPipelineBrowserWidget(myDesktop);
+ pqPipelineModel* pipelineModel = new pqPipelineModel(*pqApplicationCore::instance()->getServerManagerModel(), this);
+ pipelineModel->setView(pqActiveObjects::instance().activeView());
+ pipelineBrowserWidget = new pqPipelineBrowserWidget(myDesktop);
+ pipelineBrowserWidget->setModel(pipelineModel);
}
// Properties panel
pqParaViewMenuBuilders::buildMacrosMenu(*macrosMenu);
}
+ // Catalyst Menu
+ if (!catalystMenu) {
+ catalystMenu = new QMenu(0);
+#if PARAVIEW_VERSION_MAJOR==5 && PARAVIEW_VERSION_MINOR<9
+ pqParaViewMenuBuilders::buildCatalystMenu(*catalystMenu, myDesktop);
+#else
+ pqParaViewMenuBuilders::buildCatalystMenu(*catalystMenu);
+#endif
+ }
+
mainToolBar = new pqMainControlsToolbar(myDesktop)
<< pqSetName("MainControlsToolbar");
mainToolBar->layout()->setSpacing(0);
Q_ARG( pqServerManagerModelItem* , NULL ) );
}
+ //publishExistingSources();
myPVWidgetsFlag = true;
}
}
void PVViewer_GUIElements::setToolBarVisible(bool show)
-{
+{
QCoreApplication::processEvents();
if (!myPVWidgetsFlag)
return;
buildPVWidgets();
return macrosMenu;
}
+
+QMenu* PVViewer_GUIElements::getCatalystMenu() {
+ buildPVWidgets();
+ return catalystMenu;
+}
+
+void PVViewer_GUIElements::publishExistingSources() {
+ vtkSMSessionProxyManager* pxm = pqActiveObjects::instance().proxyManager();
+ pqServerManagerModel* smmodel = pqApplicationCore::instance()->getServerManagerModel();
+ if( !pxm || !smmodel )
+ return;
+ vtkSMProxyIterator* iter = vtkSMProxyIterator::New();
+ iter->SetModeToOneGroup();
+ iter->SetSessionProxyManager( pxm );
+ for ( iter->Begin( "sources" ); !iter->IsAtEnd(); iter->Next() ) {
+ if ( pqProxy* item = smmodel->findItem<pqProxy*>( iter->GetProxy() ) ) {
+ pqPipelineSource* source = qobject_cast<pqPipelineSource*>( item );
+ QMetaObject::invokeMethod( smmodel,
+ "sourceAdded",
+ Qt::AutoConnection,
+ Q_ARG( pqPipelineSource* , source ) );
+ }
+ }
+}