From: abn Date: Wed, 14 Oct 2015 14:24:42 +0000 (+0200) Subject: New simpler test for GIL in paraview. X-Git-Tag: V8_0_pre~3 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=7009949c96b52574750b58a5d41c5f976ddd0853;p=modules%2Fparavis.git New simpler test for GIL in paraview. --- diff --git a/test/standalone/CMakeLists.txt b/test/standalone/CMakeLists.txt index f4e851b7..f8c18436 100644 --- a/test/standalone/CMakeLists.txt +++ b/test/standalone/CMakeLists.txt @@ -20,16 +20,21 @@ PROJECT(LightPARAVIS) CMAKE_MINIMUM_REQUIRED(VERSION 2.8.10) - SET(CMAKE_BUILD_TYPE "Debug") -FIND_PACKAGE(Qt4 REQUIRED) +OPTION(LIGHTPARAVIS_WITH_GUI "Build GUI test app" ON) +# Package detection +FIND_PACKAGE(Qt4 REQUIRED) LIST(APPEND CMAKE_PREFIX_PATH "$ENV{PARAVIEW_ROOT_DIR}") -FIND_PACKAGE(ParaView 4.3 REQUIRED) +FIND_PACKAGE(ParaView REQUIRED) INCLUDE(${PARAVIEW_USE_FILE}) INCLUDE(ParaViewMacros) +SET(CMAKE_INCLUDE_CURRENT_DIR ON) -# Main application -ADD_SUBDIRECTORY(src) +# Main applications +IF(LIGHTPARAVIS_WITH_GUI) + ADD_SUBDIRECTORY(gui) +ENDIF() +ADD_SUBDIRECTORY(simple) diff --git a/test/standalone/gui/CMakeLists.txt b/test/standalone/gui/CMakeLists.txt new file mode 100644 index 00000000..3b35cb43 --- /dev/null +++ b/test/standalone/gui/CMakeLists.txt @@ -0,0 +1,76 @@ +# Copyright (C) 2010-2015 CEA/DEN, EDF R&D +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# +# Author: Adrien Bruneton (CEA) + +SET(pl_HEADERS + PLMainWindow.hxx + PLViewTab.hxx + PVViewer_Behaviors.h + PVViewer_GUIElements.h + ) + +SET(pl_OTHER_HEADERS + PVViewer_Core.h + ) + +SET(pl_SOURCES + main.cpp + PLMainWindow.cxx + PLViewTab.cxx + PVViewer_Behaviors.cxx + PVViewer_GUIElements.cxx + PVViewer_Core.cxx + ) + +SET(pl_FORMS + ui/light_para.ui + ui/view_tab.ui + ) + +SET(CMAKE_INCLUDE_CURRENT_DIR ON) +INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +INCLUDE_DIRECTORIES(${PARAVIEW_INCLUDE_DIRS}) + +INCLUDE(${QT_USE_FILE}) +ADD_DEFINITIONS(${QT_DEFINITIONS}) + +# Generate resources that will embedded +SET(ui_resources + "${CMAKE_CURRENT_BINARY_DIR}/LightPara_configuration.qrc") + +GENERATE_QT_RESOURCE_FROM_FILES( + "${ui_resources}" + "/LightPara/Configuration" + "${PROJECT_SOURCE_DIR}/src/xml/ParaViewReaders.xml") + +QT4_ADD_RESOURCES(rcs_sources + ${ui_resources} + ) +QT4_WRAP_UI(pl_FORMS_HEADERS ${pl_FORMS}) +QT4_WRAP_CPP(pl_HEADERS_MOC ${pl_HEADERS}) + +ADD_EXECUTABLE(paraLight + ${pl_SOURCES} + ${pl_HEADERS_MOC} + ${pl_FORMS_HEADERS} + ${rcs_sources}) + +TARGET_LINK_LIBRARIES(paraLight ${QT_LIBRARIES} pqApplicationComponents vtkRenderingFreeTypeOpenGL) +#INSTALL(TARGET paraLight bin) + diff --git a/test/standalone/gui/PLMainWindow.cxx b/test/standalone/gui/PLMainWindow.cxx new file mode 100644 index 00000000..7662b16f --- /dev/null +++ b/test/standalone/gui/PLMainWindow.cxx @@ -0,0 +1,272 @@ +// Copyright (C) 2010-2015 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// Author: Adrien Bruneton (CEA) + +#include "PVViewer_GUIElements.h" +#include "PLMainWindow.hxx" +#include "PVViewer_Core.h" +#include "PLViewTab.hxx" + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +PLMainWindow::PLMainWindow(QWidget *parent) : + QMainWindow(parent), + _pAppC(0), + _simplePipeline(), + _autoApply(true) +{ + _mainWindow.setupUi(this); + _autoApply = _mainWindow.actionAuto_apply->isChecked(); + QObject::connect(this, SIGNAL(apply()), this, SLOT(onApply())); + QObject::connect(this, SIGNAL(changedCurrentFile(QString)), this, SLOT(onApply())); + addTab(); +} + +// Called after ParaView application initialisation: +void PLMainWindow::finishUISetup() +{ + _pAppC = PVViewer_Core::GetPVApplication(); + PVViewer_GUIElements * pvgui = PVViewer_GUIElements::GetInstance(this); + QWidget * wprop = pvgui->getPropertiesPanel(); + QWidget * wpipe = pvgui->getPipelineBrowserWidget(); + wprop->setParent(_mainWindow.propFrame); + _mainWindow.verticalLayoutProp->addWidget(wprop); + wpipe->setParent(_mainWindow.pipelineFrame); + _mainWindow.verticalLayoutPipe->addWidget(wpipe); + + PVViewer_GUIElements * pvge = PVViewer_GUIElements::GetInstance(this); +// pvge->setToolBarVisible(false); + + // In this mockup, we play on the parent widget visibility (a QFrame), so show these: + pvge->getPipelineBrowserWidget()->show(); + pvge->getPropertiesPanel()->show(); + // and hide these: + _mainWindow.propFrame->hide(); + _mainWindow.pipelineFrame->hide(); +// pvge->setToolBarEnabled(false); +// pvge->setToolBarVisible(false); + +} + +void PLMainWindow::autoApplyCheck(bool isChecked) +{ + _autoApply = isChecked; +} + +void PLMainWindow::onApply() +{ + if (_autoApply) + { + PVViewer_GUIElements * pvgui = PVViewer_GUIElements::GetInstance(this); + pqPropertiesPanel * wprop = pvgui->getPropertiesPanel(); + wprop->apply(); + } +} + +void PLMainWindow::showProp(bool isChecked) +{ + isChecked ? _mainWindow.propFrame->show() : _mainWindow.propFrame->hide(); +} + +void PLMainWindow::showPipeline(bool isChecked) +{ + isChecked ? _mainWindow.pipelineFrame->show() : _mainWindow.pipelineFrame->hide(); +} + +void PLMainWindow::addTab() +{ + int c = _mainWindow.tabWidget->count(); + PLViewTab * newTab = new PLViewTab(_mainWindow.tabWidget); + int newIdx = _mainWindow.tabWidget->addTab(newTab, QString("Tab %1").arg(c+1)); + _mainWindow.tabWidget->setCurrentIndex(newIdx); + + // Connect buttons + QObject::connect(newTab, SIGNAL(onInsertSingleView(PLViewTab *)), this, SLOT(insertSingleView(PLViewTab *))); + QObject::connect(newTab, SIGNAL(onInsertMultiView(PLViewTab *)), this, SLOT(insertMultiView(PLViewTab *))); +} + +void PLMainWindow::deleteTab() +{ + int c = _mainWindow.tabWidget->currentIndex(); + if (c != -1) + { + _mainWindow.tabWidget->removeTab(c); + } +} + +void PLMainWindow::currentTabChanged(int tabIdx) +{ + QWidget * w = _mainWindow.tabWidget->widget(tabIdx); + if (w) + { + PLViewTab * viewtab = qobject_cast(w); + if (viewtab && viewtab->getpqView()) + { + pqActiveObjects::instance().setActiveView(viewtab->getpqView()); + } + } +} + +void PLMainWindow::doOpenFile() +{ + // Clean up vizu +// cleanAll(); + + // Load the stuff as wireframe in the main view: + QList many = pqLoadDataReaction::loadData(); + if (many.isEmpty()) + { + std::cout << "no file selected!" << std::endl; + return; + } + if (many.count() > 1) + { + QMessageBox msgBox; + msgBox.setText("Select one file only!"); + msgBox.exec(); + cleanAll(); + return; + } + + pqPipelineSource * src = many.at(0); + std::cout << "num of out ports: " << src->getNumberOfOutputPorts() << std::endl; + + // A cone to start with: +// pqPipelineSource * src = this->_pAppC->getObjectBuilder()->createSource(QString("sources"), QString("ConeSource"), +// this->_activeServer); + if(src) + _simplePipeline.push(src); + + // Retrieve loaded file name + vtkSMProperty * prop = src->getSourceProxy()->GetProperty("FileName"); + vtkSMStringVectorProperty * prop2 = vtkSMStringVectorProperty::SafeDownCast(prop); + QString fName(prop2->GetElement(0)); + + // Emit signal + emit changedCurrentFile(fName); +} + +void PLMainWindow::insertSingleView(PLViewTab * tab) +{ + // Create a new view proxy on the server + pqObjectBuilder* builder = _pAppC->getObjectBuilder(); + pqServer* active_serv = pqActiveObjects::instance().activeServer(); + + std::cout << "About to create single view ..." << std::endl; + pqView * pqview = builder->createView(QString("RenderView"), active_serv); + std::cout << "Created: " << pqview << "!" << std::endl; + + // Retrieve its widget and pass it to the Qt tab: + QWidget* viewWidget = pqview->getWidget(); + +// QWidget* viewWidget = new QPushButton("toto"); + tab->hideAndReplace(viewWidget, pqview); + + pqActiveObjects::instance().setActiveView(pqview); +} + +void PLMainWindow::insertMultiView(PLViewTab * tab) +{ + // Retrieve TabbedMultiView and see if it is already attached to someone: + PVViewer_GUIElements * pvgui = PVViewer_GUIElements::GetInstance(this); + pqTabbedMultiViewWidget * multiv = pvgui->getTabbedMultiViewWidget(); + + QWidget * parent = multiv->nativeParentWidget(); + if (parent) + { + QMessageBox msgBox; + msgBox.setText("Multi-view already in use in another tab! Close it first."); + msgBox.exec(); + } + else + { + tab->hideAndReplace(multiv, NULL); + } +} + + +void PLMainWindow::doShrink() +{ + if(!_simplePipeline.isEmpty()) + { + cleanAllButSource(); + + pqPipelineSource * src = this->_pAppC->getObjectBuilder()->createFilter(QString("filters"), + QString("ShrinkFilter"), _simplePipeline.top()); + if(src) + _simplePipeline.push(src); + + // Hit apply + emit apply(); + } +} + +void PLMainWindow::doSlice() +{ + if(!_simplePipeline.isEmpty()) + { + cleanAllButSource(); + + pqPipelineSource * src = this->_pAppC->getObjectBuilder()->createFilter(QString("filters"), + QString("Cut"), _simplePipeline.top()); + if(src) + _simplePipeline.push(src); + + // Hit apply + emit apply(); + } +} + +void PLMainWindow::doManagePlugins() +{ + pqManagePluginsReaction::managePlugins(); +} + +void PLMainWindow::cleanAll() +{ + this->_pAppC->getObjectBuilder()->destroyPipelineProxies(); + _simplePipeline.resize(0); +} + +void PLMainWindow::cleanAllButSource() +{ + while(_simplePipeline.size() > 1) + this->_pAppC->getObjectBuilder()->destroy(_simplePipeline.pop()); +} diff --git a/test/standalone/gui/PLMainWindow.hxx b/test/standalone/gui/PLMainWindow.hxx new file mode 100644 index 00000000..2fee621a --- /dev/null +++ b/test/standalone/gui/PLMainWindow.hxx @@ -0,0 +1,90 @@ +// Copyright (C) 2010-2015 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// Author: Adrien Bruneton (CEA) + +#ifndef PLVIEWWIDGET_H_ +#define PLVIEWWIDGET_H_ + +#include +#include "ui_light_para.h" +#include + +class pqPVApplicationCore; +class pqPipelineSource; +class pqServer; +class pqProxy; + +class PLViewTab; + +/** Main window of the application. + */ +class PLMainWindow: public QMainWindow { + Q_OBJECT + +public: + PLMainWindow(QWidget * parent=0); + virtual ~PLMainWindow() {} + + void finishUISetup(); + +protected: + void doOpenFile(); + void doManagePlugins(); + + void doSlice(); + void doShrink(); + + void cleanAll(); + void cleanAllButSource(); + +signals: + void changedCurrentFile(QString fileName); + void apply(); // convenience signal to forward to the real ParaView apply + +private slots: + void autoApplyCheck(bool); + void onApply(); + void showPipeline(bool); + void showProp(bool); + + void addTab(); + void deleteTab(); + + void onFileOpen() { doOpenFile(); }; + void slice() { doSlice(); }; + void shrink() { doShrink(); }; + void managePlugins() { doManagePlugins(); }; + + void insertSingleView(PLViewTab *); + void insertMultiView(PLViewTab *); + + void currentTabChanged(int); + +private: + Ui::MainWindow _mainWindow; + + pqPVApplicationCore * _pAppC; + //pqServer * _activeServer; + //pqPipelineSource * _activeSource; // last pipeline element + QStack _simplePipeline; + + bool _autoApply; +}; + +#endif /* PLVIEWWIDGET_H_ */ diff --git a/test/standalone/gui/PLViewTab.cxx b/test/standalone/gui/PLViewTab.cxx new file mode 100644 index 00000000..6ee1fd2f --- /dev/null +++ b/test/standalone/gui/PLViewTab.cxx @@ -0,0 +1,54 @@ +// Copyright (C) 2010-2015 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// Author: Adrien Bruneton (CEA) + +#include +#include "PLViewTab.hxx" + +PLViewTab::PLViewTab(QWidget * parent): +QWidget(parent), +_renderView(0) +{ + _viewTab.setupUi(this); +} + +void PLViewTab::insertSingleView() +{ + emit onInsertSingleView(this); +} + +void PLViewTab::insertMultiView() +{ + emit onInsertMultiView(this); +} + +void PLViewTab::hideAndReplace(QWidget * w, pqView * view) +{ + _viewTab.frameButtons->hide(); + w->setParent(_viewTab.frameView); + QVBoxLayout * vbox = _viewTab.verticalLayoutView; + vbox->addWidget(w); + _renderView = view; +} + +void PLViewTab::viewDestroyed() +{ + std::cout << "View destroyed!" << std::endl; +} + diff --git a/test/standalone/gui/PLViewTab.hxx b/test/standalone/gui/PLViewTab.hxx new file mode 100644 index 00000000..c6f5cb13 --- /dev/null +++ b/test/standalone/gui/PLViewTab.hxx @@ -0,0 +1,56 @@ +// Copyright (C) 2010-2015 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// Author: Adrien Bruneton (CEA) + +#ifndef SRC_PLVIEWTAB_HXX_ +#define SRC_PLVIEWTAB_HXX_ + +#include "ui_view_tab.h" + +class pqView; + +/** Widget inserted when a new tab is requested in the application. + */ +class PLViewTab: public QWidget { + Q_OBJECT + +public: + PLViewTab(QWidget * parent=0); + virtual ~PLViewTab() {} + + // Hide buttons, and put widget in the QFrame with a vertical layout + void hideAndReplace(QWidget * w, pqView * view); + + pqView * getpqView() { return _renderView; } + +private slots: + void insertSingleView(); + void insertMultiView(); + void viewDestroyed(); + +signals: + void onInsertSingleView(PLViewTab *); + void onInsertMultiView(PLViewTab *); + +private: + Ui::ViewTab _viewTab; + pqView * _renderView; +}; + +#endif /* SRC_PLVIEWTAB_HXX_ */ diff --git a/test/standalone/gui/PVViewer_Behaviors.cxx b/test/standalone/gui/PVViewer_Behaviors.cxx new file mode 100644 index 00000000..fefe75e5 --- /dev/null +++ b/test/standalone/gui/PVViewer_Behaviors.cxx @@ -0,0 +1,128 @@ +// Copyright (C) 2010-2015 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// Author: Adrien Bruneton (CEA) + +#include "PVViewer_Behaviors.h" + +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +int PVViewer_Behaviors::BehaviorLoadingLevel = 0; + +PVViewer_Behaviors::PVViewer_Behaviors(QMainWindow * parent) + : QObject(parent) +{ +} + +/**! Instanciate minimal ParaView behaviors needed when using an instance of PVViewer. + * This method should be updated at each new version of ParaView with what is found in + * Qt/ApplicationComponents/pqParaViewBehaviors.cxx + */ +void PVViewer_Behaviors::instanciateMinimalBehaviors(QMainWindow * desk) +{ + if (BehaviorLoadingLevel < 1) + { + // Register ParaView interfaces. + pqInterfaceTracker* pgm = pqApplicationCore::instance()->interfaceTracker(); + + // Register standard types of property widgets. + pgm->addInterface(new pqStandardPropertyWidgetInterface(pgm)); + // Register standard types of view-frame actions. + pgm->addInterface(new pqStandardViewFrameActionsImplementation(pgm)); + + // Load plugins distributed with application. + pqApplicationCore::instance()->loadDistributedPlugins(); + + new pqDefaultViewBehavior(this); // shows a 3D view as soon as a server connection is made + new pqAlwaysConnectedBehavior(this); // client always connected to a server + new pqVerifyRequiredPluginBehavior(this); + new pqPluginSettingsBehavior(this); + new pqFixPathsInStateFilesBehavior(this); + new pqCrashRecoveryBehavior(this); + new pqCommandLineOptionsBehavior(this); + + BehaviorLoadingLevel = 1; + } +} + +/**! Instanciate usual ParaView behaviors. + * This method should be updated at each new version of ParaView with what is found in + * Qt/ApplicationComponents/pqParaViewBehaviors.cxx + */ +void PVViewer_Behaviors::instanciateAllBehaviors(QMainWindow * desk) +{ + // "new pqParaViewBehaviors(anApp->desktop(), this);" + // -> (which loads all standard ParaView behaviors at once) has to be replaced in order to + // exclude using of pqQtMessageHandlerBehaviour + + // Define application behaviors. + if (BehaviorLoadingLevel < 1) + instanciateMinimalBehaviors(desk); + + if (BehaviorLoadingLevel < 2) + { + //new pqQtMessageHandlerBehavior(this); // THIS ONE TO EXCLUDE !! see comment above + new pqDataTimeStepBehavior(this); + new pqSpreadSheetVisibilityBehavior(this); + new pqPipelineContextMenuBehavior(this); + new pqUndoRedoBehavior(this); + new pqAutoLoadPluginXMLBehavior(this); // auto load plugins GUI stuff + new pqPluginDockWidgetsBehavior(desk); + new pqPluginActionGroupBehavior(desk); + new pqPersistentMainWindowStateBehavior(desk); + new pqObjectPickingBehavior(desk); + new pqCollaborationBehavior(this); + new pqViewStreamingBehavior(this); + + pqApplyBehavior* applyBehavior = new pqApplyBehavior(this); + foreach (pqPropertiesPanel* ppanel, desk->findChildren()) + { + applyBehavior->registerPanel(ppanel); + } + BehaviorLoadingLevel = 2; + } +} diff --git a/test/standalone/gui/PVViewer_Behaviors.h b/test/standalone/gui/PVViewer_Behaviors.h new file mode 100644 index 00000000..7b6c9cfa --- /dev/null +++ b/test/standalone/gui/PVViewer_Behaviors.h @@ -0,0 +1,51 @@ +// Copyright (C) 2010-2015 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// Author: Adrien Bruneton (CEA) + + +#ifndef PVGUIBEHAVIORS_H_ +#define PVGUIBEHAVIORS_H_ + +#include + +class QMainWindow; +class pqPropertiesPanel; + +/**! + * PARAVIS behaviors - mimic what is done in + * Qt/ApplicationComponents/pqParaViewBehaviors.cxx + * Except a few ones, behaviors are destroyed when the module is destroyed. + */ +class PVViewer_Behaviors: public QObject +{ + Q_OBJECT + +public: + PVViewer_Behaviors(QMainWindow * parent); + + void instanciateMinimalBehaviors(QMainWindow * desk); + void instanciateAllBehaviors(QMainWindow * desk); + + virtual ~PVViewer_Behaviors() {} + +private: + static int BehaviorLoadingLevel; +}; + +#endif /* PVGUIBEHAVIORS_H_ */ diff --git a/test/standalone/gui/PVViewer_Core.cxx b/test/standalone/gui/PVViewer_Core.cxx new file mode 100644 index 00000000..319179cf --- /dev/null +++ b/test/standalone/gui/PVViewer_Core.cxx @@ -0,0 +1,140 @@ +// Copyright (C) 2010-2015 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// Author : Adrien Bruneton (CEA) +// + +#include "PVViewer_Core.h" +//#include "PVViewer_LogWindowAdapter.h" +#include "PVViewer_GUIElements.h" +#include "PVViewer_Behaviors.h" +#include "PVViewer_Core.h" + +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + + +//---------- Static init ----------------- +pqPVApplicationCore* PVViewer_Core::MyCoreApp = 0; +bool PVViewer_Core::ConfigLoaded = false; +PVViewer_Behaviors * PVViewer_Core::ParaviewBehaviors = NULL; + +pqPVApplicationCore * PVViewer_Core::GetPVApplication() +{ + return MyCoreApp; +} + +/*! + \brief Static method, performs initialization of ParaView session. + \param fullSetup whether to instanciate all behaviors or just the minimal ones. + \return \c true if ParaView has been initialized successfully, otherwise false +*/ +bool PVViewer_Core::ParaviewInitApp(QMainWindow * aDesktop, LogWindow * logWindow) +{ + if ( ! MyCoreApp) { + // Obtain command-line arguments + int argc = 0; + char** argv = 0; + QString aOptions = getenv("PARAVIEW_OPTIONS"); + QStringList aOptList = aOptions.split(":", QString::SkipEmptyParts); + argv = new char*[aOptList.size() + 1]; + QStringList args = QApplication::arguments(); + argv[0] = (args.size() > 0)? strdup(args[0].toLatin1().constData()) : strdup("paravis"); + argc++; + + foreach (QString aStr, aOptList) { + argv[argc] = strdup( aStr.toLatin1().constData() ); + argc++; + } + MyCoreApp = new pqPVApplicationCore (argc, argv); + if (MyCoreApp->getOptions()->GetHelpSelected() || + MyCoreApp->getOptions()->GetUnknownArgument() || + MyCoreApp->getOptions()->GetErrorMessage() || + MyCoreApp->getOptions()->GetTellVersion()) { + return false; + } + + // Direct VTK log messages to our SALOME window - TODO: review this +// PVViewer_LogWindowAdapter * w = PVViewer_LogWindowAdapter::New(); +// w->setLogWindow(logWindow); +// vtkOutputWindow::SetInstance(w); + +// new pqTabbedMultiViewWidget(); // registers a "MULTIVIEW_WIDGET" on creation + + for (int i = 0; i < argc; i++) + free(argv[i]); + delete[] argv; + } + // Initialize GUI elements if needed: + PVViewer_GUIElements::GetInstance(aDesktop); + return true; +} + +void PVViewer_Core::ParaviewInitBehaviors(bool fullSetup, QMainWindow* aDesktop) +{ + if (!ParaviewBehaviors) + ParaviewBehaviors = new PVViewer_Behaviors(aDesktop); + + if(fullSetup) + ParaviewBehaviors->instanciateAllBehaviors(aDesktop); + else + ParaviewBehaviors->instanciateMinimalBehaviors(aDesktop); +} + +void PVViewer_Core::ParaviewLoadConfigurations(const QString & configPath, bool force) +{ + if (!ConfigLoaded || force) + { + if (!configPath.isNull()) { + MyCoreApp->loadConfiguration(configPath + QDir::separator() + "ParaViewFilters.xml"); + MyCoreApp->loadConfiguration(configPath + QDir::separator() + "ParaViewSources.xml"); + } + ConfigLoaded = true; + } +} + +void PVViewer_Core::ParaviewCleanup() +{ + // Disconnect from server + pqServer* server = pqActiveObjects::instance().activeServer(); + if (server && server->isRemote()) + { + pqServerDisconnectReaction::disconnectFromServer(); + } + + pqApplicationCore::instance()->settings()->sync(); + + pqPVApplicationCore * app = GetPVApplication(); + // Schedule destruction of PVApplication singleton: + if (app) + app->deleteLater(); +} + diff --git a/test/standalone/gui/PVViewer_Core.h b/test/standalone/gui/PVViewer_Core.h new file mode 100644 index 00000000..b8e96c85 --- /dev/null +++ b/test/standalone/gui/PVViewer_Core.h @@ -0,0 +1,57 @@ +// Copyright (C) 2010-2015 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// Author : Adrien Bruneton (CEA) + +#ifndef SRC_PVVIEWER_PVVIEWER_CORE_H_ +#define SRC_PVVIEWER_PVVIEWER_CORE_H_ + +#include + +class PVServer_ServiceWrapper; +class PVViewer_Behaviors; +class LogWindow; +class QMainWindow; +class pqPVApplicationCore; + +/** + Pure static class gathering most of the interactions with ParaView's API and ParaView's + start sequence. + */ +class PVViewer_Core +{ +public: + static pqPVApplicationCore * GetPVApplication(); + + + //! Initialize ParaView if not yet done (once per session) + static bool ParaviewInitApp(QMainWindow* aDesktop, LogWindow * w); + static void ParaviewInitBehaviors(bool fullSetup=false, QMainWindow* aDesktop=0); + static void ParaviewLoadConfigurations(const QString & configPath, bool force=false); + static void ParaviewCleanup(); + +private: + PVViewer_Core(); + virtual ~PVViewer_Core(); + + static pqPVApplicationCore* MyCoreApp; + static bool ConfigLoaded; + static PVViewer_Behaviors * ParaviewBehaviors; +}; + +#endif /* SRC_PVVIEWER_PVVIEWER_CORE_H_ */ diff --git a/test/standalone/gui/PVViewer_GUIElements.cxx b/test/standalone/gui/PVViewer_GUIElements.cxx new file mode 100644 index 00000000..e008c225 --- /dev/null +++ b/test/standalone/gui/PVViewer_GUIElements.cxx @@ -0,0 +1,245 @@ +// Copyright (C) 2010-2015 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// Author: Adrien Bruneton (CEA) + +#include + +#include "PVViewer_GUIElements.h" +#include "PVViewer_Core.h" + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include + +#include + +PVViewer_GUIElements * PVViewer_GUIElements::theInstance = 0; + +PVViewer_GUIElements::PVViewer_GUIElements(QMainWindow* desk) : + propertiesPanel(0), pipelineBrowserWidget(0), + sourcesMenu(0) +{ + propertiesPanel = new pqPropertiesPanel(desk); + propertiesPanel->hide(); + pipelineBrowserWidget = new pqPipelineBrowserWidget(desk); + pipelineBrowserWidget->hide(); + + sourcesMenu = new QMenu(0); + pqParaViewMenuBuilders::buildSourcesMenu(*sourcesMenu, desk); + filtersMenu = new QMenu(0); + pqParaViewMenuBuilders::buildFiltersMenu(*filtersMenu, desk); + macrosMenu = new QMenu(0); + pqParaViewMenuBuilders::buildMacrosMenu(*macrosMenu); + + //myBuildToolbars(desk); +} + +PVViewer_GUIElements * PVViewer_GUIElements::GetInstance(QMainWindow* desk) +{ + if (! theInstance) + theInstance = new PVViewer_GUIElements(desk); + return theInstance; +} + + +pqTabbedMultiViewWidget * PVViewer_GUIElements::getTabbedMultiViewWidget() +{ + pqTabbedMultiViewWidget * multiv = + qobject_cast(PVViewer_Core::GetPVApplication()->manager("MULTIVIEW_WIDGET")); + + // If not found, instanciate it. It will then register automatically as a MULTIVIEW_WIDGET. + // Also create a single view that will be attached by the tabbedMultiView automatically + // (in PV this is done automatically upon server connection event). + if (!multiv) + { + multiv = new pqTabbedMultiViewWidget(); + + // Create a new view proxy on the server + pqObjectBuilder* builder = pqApplicationCore::instance()->getObjectBuilder(); + pqServer* active_serv = pqActiveObjects::instance().activeServer(); + pqView * pqview = builder->createView(QString("RenderView"), active_serv); + } + + return multiv; +} + + +/** + * See ParaView source code: pqParaViewMenuBuilders::buildToolbars() + * to keep this function up to date: + */ +void PVViewer_GUIElements::myBuildToolbars(QMainWindow* mainWindow) +{ + mainToolBar = new pqMainControlsToolbar(mainWindow) + << pqSetName("MainControlsToolbar"); + mainToolBar->layout()->setSpacing(0); + + vcrToolbar = new pqVCRToolbar(mainWindow) + << pqSetName("VCRToolbar"); + vcrToolbar->layout()->setSpacing(0); + + timeToolbar = new pqAnimationTimeToolbar(mainWindow) + << pqSetName("currentTimeToolbar"); + timeToolbar->layout()->setSpacing(0); + + colorToolbar = new pqColorToolbar(mainWindow) + << pqSetName("variableToolbar"); + colorToolbar->layout()->setSpacing(0); + + reprToolbar = new pqRepresentationToolbar(mainWindow) + << pqSetName("representationToolbar"); + reprToolbar->layout()->setSpacing(0); + + cameraToolbar = new pqCameraToolbar(mainWindow) + << pqSetName("cameraToolbar"); + cameraToolbar->layout()->setSpacing(0); + + axesToolbar = new pqAxesToolbar(mainWindow) + << pqSetName("axesToolbar"); + axesToolbar->layout()->setSpacing(0); + + // Give the macros menu to the pqPythonMacroSupervisor + pqPythonManager* manager = qobject_cast( + pqApplicationCore::instance()->manager("PYTHON_MANAGER")); + + macrosToolbar = new QToolBar("Macros Toolbars", mainWindow) + << pqSetName("MacrosToolbar"); + manager->addWidgetForRunMacros(macrosToolbar); + + commonToolbar = new QToolBar("Common", mainWindow) << pqSetName("Common"); + commonToolbar->layout()->setSpacing(0); + + dataToolbar = new QToolBar("DataAnalysis", mainWindow) << pqSetName("DataAnalysis"); + dataToolbar->layout()->setSpacing(0); + + //addToolbars(mainWindow); +} + +void PVViewer_GUIElements::setToolBarVisible(bool show) +{ + QCoreApplication::processEvents(); + mainAction->setChecked(!show); + mainAction->setVisible(show); + mainAction->trigger(); + vcrAction->setChecked(!show); + vcrAction->setVisible(show); + vcrAction->trigger(); + timeAction->setChecked(!show); + timeAction->setVisible(show); + timeAction->trigger(); + colorAction->setChecked(!show); + colorAction->setVisible(show); + colorAction->trigger(); + reprAction->setChecked(!show); + reprAction->setVisible(show); + reprAction->trigger(); + cameraAction->setChecked(!show); + cameraAction->setVisible(show); + cameraAction->trigger(); + axesAction->setChecked(!show); + axesAction->setVisible(show); + axesAction->trigger(); + macrosAction->setChecked(!show); + macrosAction->setVisible(show); + macrosAction->trigger(); + commonAction->setChecked(!show); + commonAction->setVisible(show); + commonAction->trigger(); + dataAction->setChecked(!show); + dataAction->setVisible(show); + dataAction->trigger(); +} + +void PVViewer_GUIElements::addToolbars(QMainWindow* desk) +{ + desk->addToolBar(Qt::TopToolBarArea, mainToolBar); + desk->addToolBar(Qt::TopToolBarArea, vcrToolbar); + desk->addToolBar(Qt::TopToolBarArea, timeToolbar); + desk->addToolBar(Qt::TopToolBarArea, colorToolbar); + desk->insertToolBarBreak(colorToolbar); + desk->addToolBar(Qt::TopToolBarArea, reprToolbar); + desk->addToolBar(Qt::TopToolBarArea, cameraToolbar); + desk->addToolBar(Qt::TopToolBarArea, axesToolbar); + desk->addToolBar(Qt::TopToolBarArea, macrosToolbar); + desk->addToolBar(Qt::TopToolBarArea, commonToolbar); + desk->addToolBar(Qt::TopToolBarArea, dataToolbar); + + mainAction = mainToolBar->toggleViewAction(); + vcrAction = vcrToolbar->toggleViewAction(); + timeAction = timeToolbar->toggleViewAction(); + colorAction = colorToolbar->toggleViewAction(); + reprAction = reprToolbar->toggleViewAction(); + cameraAction = cameraToolbar->toggleViewAction(); + axesAction = axesToolbar->toggleViewAction(); + macrosAction = macrosToolbar->toggleViewAction(); + commonAction = commonToolbar->toggleViewAction(); + dataAction = dataToolbar->toggleViewAction(); +} + +void PVViewer_GUIElements::onEmulateApply() +{ + if (propertiesPanel) + propertiesPanel->apply(); +} + +QList PVViewer_GUIElements::getToolbars() +{ + QList l; + l << mainToolBar << vcrToolbar << timeToolbar << colorToolbar + << reprToolbar << cameraToolbar << axesToolbar << macrosToolbar + << commonToolbar << dataToolbar; + return l; +} + +void PVViewer_GUIElements::setToolBarEnabled(bool enabled) +{ + mainToolBar ->setEnabled(enabled); + vcrToolbar ->setEnabled(enabled); + timeToolbar ->setEnabled(enabled); + colorToolbar ->setEnabled(enabled); + reprToolbar ->setEnabled(enabled); + cameraToolbar->setEnabled(enabled); + axesToolbar ->setEnabled(enabled); + macrosToolbar->setEnabled(enabled); + commonToolbar->setEnabled(enabled); + dataToolbar ->setEnabled(enabled); +} diff --git a/test/standalone/gui/PVViewer_GUIElements.h b/test/standalone/gui/PVViewer_GUIElements.h new file mode 100644 index 00000000..33afc038 --- /dev/null +++ b/test/standalone/gui/PVViewer_GUIElements.h @@ -0,0 +1,109 @@ +// Copyright (C) 2010-2015 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// Author: Adrien Bruneton (CEA) + +#ifndef PVVIEWERGUIELEMENTS_H_ +#define PVVIEWERGUIELEMENTS_H_ + +#include +#include + +class pqPropertiesPanel; +class pqPipelineBrowserWidget; +class pqTabbedMultiViewWidget; +class QMainWindow; +class QMenu; +class QToolBar; +class QAction; +class pqAnimationTimeToolbar; +class pqVCRToolbar; + +/*! + * Some GUI elements of ParaView need to be instanciated in a proper order. This class + * holds all of them for the sake of clarity. + */ +class PVViewer_GUIElements: public QObject +{ + Q_OBJECT + +public: + static PVViewer_GUIElements * GetInstance(QMainWindow * desk); + + pqPropertiesPanel * getPropertiesPanel() { return propertiesPanel; } + pqPipelineBrowserWidget * getPipelineBrowserWidget() { return pipelineBrowserWidget; } + pqTabbedMultiViewWidget * getTabbedMultiViewWidget(); + + QMenu* getFiltersMenu() { return filtersMenu; } + QMenu* getSourcesMenu() { return sourcesMenu; } + QMenu* getMacrosMenu() { return macrosMenu; } + + pqVCRToolbar* getVCRToolbar() { return vcrToolbar; } + pqAnimationTimeToolbar* getTimeToolbar() { return timeToolbar; } + + void myBuildToolbars(QMainWindow* desk); + void addToolbars(QMainWindow* desk); + void setToolBarVisible(bool show); + void setToolBarEnabled(bool enabled); + QList getToolbars(); + +public slots: + void onEmulateApply(); // better use the slot from PVViewer_ViewManager if you want to trigger "Apply" + +private: + PVViewer_GUIElements(QMainWindow* desk); + virtual ~PVViewer_GUIElements() {} + + static PVViewer_GUIElements* theInstance; + + // Widgets + pqPropertiesPanel* propertiesPanel; + pqPipelineBrowserWidget* pipelineBrowserWidget; + pqTabbedMultiViewWidget* tabbedMultiViewWidget; + + // Dummy QMenus receiving ParaView's reaction for automatic add when new sources are added + QMenu* sourcesMenu; + QMenu* filtersMenu; + QMenu* macrosMenu; + + // Toolbars also need to be instanciated early: + QToolBar* mainToolBar; + pqVCRToolbar* vcrToolbar; + pqAnimationTimeToolbar* timeToolbar; + QToolBar* colorToolbar; + QToolBar* reprToolbar; + QToolBar* cameraToolbar; + QToolBar* axesToolbar; + QToolBar* macrosToolbar; + QToolBar* commonToolbar; + QToolBar* dataToolbar; + +public: + QAction* mainAction; + QAction* vcrAction; + QAction* timeAction; + QAction* colorAction; + QAction* reprAction; + QAction* cameraAction; + QAction* axesAction; + QAction* macrosAction; + QAction* commonAction; + QAction* dataAction; +}; + +#endif /* PVVIEWERGUIELEMENTS_H_ */ diff --git a/test/standalone/gui/README.txt b/test/standalone/gui/README.txt new file mode 100644 index 00000000..9dd99191 --- /dev/null +++ b/test/standalone/gui/README.txt @@ -0,0 +1,15 @@ +This light application was built to mimick the key elements at hand +when integrating ParaView into SALOME (i.e. when designing PARAVIS). + +Notably the following classes are (almost) a copy/paste of what is +found in the PVViewer subfolder of GUI: + PVViewer_Core + PVViewer_GUIElements + PVViewer_Behaviors + +The application should have a boot sequence similar to the start-up +of the PVViewer in SALOME, or to the activation of the PARAVIS module. + +The main executable is called + paraLight +and is *not* installed (it can be executed from the build directory). diff --git a/test/standalone/gui/main.cpp b/test/standalone/gui/main.cpp new file mode 100644 index 00000000..c8bf7632 --- /dev/null +++ b/test/standalone/gui/main.cpp @@ -0,0 +1,95 @@ +// Copyright (C) 2010-2015 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// Author: Adrien Bruneton (CEA) + +#include + +#include "PVViewer_Core.h" +#include "PVViewer_Behaviors.h" +#include "PLMainWindow.hxx" + +#include +#include +#include +#include +#include +#include + +int main(int argc, char ** argv) +{ + std::cout << "Starting LightParaView ..." << std::endl; + + std::cout << "Init Qt app ..." << std::endl; + QApplication qtapp(argc, argv); + QApplication::setApplicationName("LightPara"); + + std::cout << "Create Qt main window ..." << std::endl; + PLMainWindow * para_widget = new PLMainWindow(); + + std::cout << "Init appli core ..." << std::endl; + PVViewer_Core::ParaviewInitApp(para_widget, NULL); + + std::cout << "Binding ParaView widget in QMainWindow ..." << std::endl; + para_widget->finishUISetup(); + + /* Install event filter */ +// std::cout << "Install event filter ..." << std::endl; +// pqPVApplicationCore * plApp = PVViewer_Core::GetPVApplication(); +// QApplication::instance()->installEventFilter(plApp); + + std::cout << "Init behaviors ..." << std::endl; + PVViewer_Core::ParaviewInitBehaviors(true, para_widget); + + //para_widget->updateActiveServer(); + + //std::cout << "Load config ..." << std::endl; + //PVViewer_Core::ParaviewLoadConfigurations(QString(":/LightPara/Configuration/")); + + /* Inspired from ParaView source code: + * leave time for the GUI to update itself before displaying the main window: */ + QApplication::instance()->processEvents(); + + // Try to connect +// std::cout << "about to try to connect ...\n"; +// const char * server_url = "cs://localhost"; +// if (!pqServerConnectReaction::connectToServer(pqServerResource(server_url))) +// { +// std::cerr << "Could not connect to requested server \"" +// << server_url << "\". Creating default builtin connection.\n"; +// } + + /* ... and GO: */ + std::cout << "Show !" << std::endl; + para_widget->show(); + int ret_code = qtapp.exec(); + + /* then disconnect and leave nicely */ + //pqServerDisconnectReaction::disconnectFromServer(); + + std::cout << "Clean up ..." << std::endl; + PVViewer_Core::ParaviewCleanup(); + + delete para_widget; + + std::cout << "Done." << std::endl; + return ret_code; +} + + + diff --git a/test/standalone/gui/ui/light_para.ui b/test/standalone/gui/ui/light_para.ui new file mode 100644 index 00000000..47c38e3a --- /dev/null +++ b/test/standalone/gui/ui/light_para.ui @@ -0,0 +1,654 @@ + + + MainWindow + + + + 0 + 0 + 1010 + 678 + + + + PARAVIS Light! + + + + + + + Qt::Horizontal + + + + Qt::Vertical + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + + + + + + -1 + + + + + + + + + + Chosen file: + + + + + + + true + + + + + + + Open ... + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Add tab ... + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Delete current tab + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Manage Plugins ... + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Slice + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Shrink + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Quit + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + 0 + 0 + 1010 + 22 + + + + + File + + + + + + + Simple actions + + + + + + + Tabs + + + + + + + Options + + + + + + + + + + + + + + Open file ... + + + + + Quit + + + + + Slice + + + + + Shrink + + + + + Add tab + + + + + Delete tab + + + + + true + + + true + + + Auto apply + + + + + true + + + false + + + Show prop widget + + + + + true + + + false + + + Show pipeline + + + + + + + quitButton + clicked() + MainWindow + close() + + + 871 + 588 + + + 439 + 210 + + + + + openButton + clicked() + MainWindow + onFileOpen() + + + 1004 + 271 + + + 456 + 258 + + + + + MainWindow + changedCurrentFile(QString) + currentFileLabel + setText(QString) + + + 456 + 258 + + + 211 + 259 + + + + + shrinkButton + clicked() + MainWindow + shrink() + + + 674 + 588 + + + 456 + 258 + + + + + sliceButton + clicked() + MainWindow + slice() + + + 472 + 588 + + + 504 + 338 + + + + + pluginsButton + clicked() + MainWindow + managePlugins() + + + 279 + 588 + + + 504 + 338 + + + + + actionSlice + triggered() + MainWindow + slice() + + + -1 + -1 + + + 504 + 338 + + + + + actionShrink + triggered() + MainWindow + shrink() + + + -1 + -1 + + + 504 + 338 + + + + + actionOpen_file + triggered() + MainWindow + onFileOpen() + + + -1 + -1 + + + 504 + 338 + + + + + actionQuit + triggered() + MainWindow + close() + + + -1 + -1 + + + 504 + 338 + + + + + actionAdd_tab + triggered() + MainWindow + addTab() + + + -1 + -1 + + + 504 + 338 + + + + + actionDelete_tab + triggered() + MainWindow + deleteTab() + + + -1 + -1 + + + 504 + 338 + + + + + addTabButton + clicked() + MainWindow + addTab() + + + 350 + 430 + + + 504 + 338 + + + + + detTabButton + clicked() + MainWindow + deleteTab() + + + 750 + 430 + + + 504 + 338 + + + + + actionAuto_apply + toggled(bool) + MainWindow + autoApplyCheck(bool) + + + -1 + -1 + + + 504 + 338 + + + + + actionShow_pipeline + toggled(bool) + MainWindow + showPipeline(bool) + + + -1 + -1 + + + 504 + 338 + + + + + actionShow_prop_widget + toggled(bool) + MainWindow + showProp(bool) + + + -1 + -1 + + + 504 + 338 + + + + + tabWidget + currentChanged(int) + MainWindow + currentTabChanged(int) + + + 894 + 101 + + + 504 + 338 + + + + + + changedCurrentFile(QString) + onFileOpen() + slice() + shrink() + managePlugins() + addTab() + deleteTab() + autoApplyCheck(bool) + showPipeline(bool) + showProp(bool) + currentTabChanged(int) + + diff --git a/test/standalone/gui/ui/view_tab.ui b/test/standalone/gui/ui/view_tab.ui new file mode 100644 index 00000000..67cae6a8 --- /dev/null +++ b/test/standalone/gui/ui/view_tab.ui @@ -0,0 +1,144 @@ + + + ViewTab + + + + 0 + 0 + 550 + 620 + + + + Form + + + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + Qt::Vertical + + + + 20 + 243 + + + + + + + + + 75 + true + + + + Qt::LeftToRight + + + Choose what to display: + + + Qt::AlignCenter + + + + + + + Tabbed multi-view widget + + + + + + + Single render view + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + + + + + + + + + singleViewButton + clicked() + ViewTab + insertSingleView() + + + 170 + 262 + + + 170 + 239 + + + + + showTabbedButton + clicked() + ViewTab + insertMultiView() + + + 170 + 234 + + + 170 + 239 + + + + + + insertMultiView() + insertSingleView() + + diff --git a/test/standalone/gui/xml/ParaViewReaders.xml b/test/standalone/gui/xml/ParaViewReaders.xml new file mode 100644 index 00000000..9c3ce004 --- /dev/null +++ b/test/standalone/gui/xml/ParaViewReaders.xml @@ -0,0 +1,79 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/standalone/simple/CMakeLists.txt b/test/standalone/simple/CMakeLists.txt new file mode 100644 index 00000000..3ae3cecb --- /dev/null +++ b/test/standalone/simple/CMakeLists.txt @@ -0,0 +1,36 @@ +# Copyright (C) 2010-2015 CEA/DEN, EDF R&D +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# +# Author: Adrien Bruneton (CEA) + +SET(pl_SOURCES + simple_gil.cxx + #PyInterp_Interp.cxx + #SUITApp_init_python.cxx + Container_init_python.cxx + ) + +INCLUDE_DIRECTORIES( + ${PARAVIEW_INCLUDE_DIRS} + ${PYTHON_INCLUDE_DIRS} + ${QT_INCLUDE_DIRS} + ) + +ADD_EXECUTABLE(paraCmdLine ${pl_SOURCES}) +TARGET_LINK_LIBRARIES(paraCmdLine ${PYTHON_LIBRARIES} ${QT_LIBRARIES} pqApplicationComponents) + diff --git a/test/standalone/simple/Container_init_python.cxx b/test/standalone/simple/Container_init_python.cxx new file mode 100644 index 00000000..ed720f1b --- /dev/null +++ b/test/standalone/simple/Container_init_python.cxx @@ -0,0 +1,62 @@ +// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +// SALOME Container : implementation of container and engine for Kernel +// File : Container_init_python.cxx +// Author : Paul RASCLE, EDF +// Module : KERNEL +// $Header$ +// +#include +#ifndef WIN32 + #include +#endif +#include + +//#include "utilities.h" +#define MESSAGE(a) + +#include "Container_init_python.hxx" + +void KERNEL_PYTHON::init_python(int argc, char **argv) +{ + if (Py_IsInitialized()) + { + MESSAGE("Python already initialized"); + return; + } + MESSAGE("================================================================="); + MESSAGE("Python Initialization..."); + MESSAGE("================================================================="); + // set stdout to line buffering (aka C++ std::cout) + setvbuf(stdout, (char *)NULL, _IOLBF, BUFSIZ); + char* salome_python=getenv("SALOME_PYTHON"); + if(salome_python != 0) + Py_SetProgramName(salome_python); + Py_Initialize(); // Initialize the interpreter + PySys_SetArgv(argc, argv); + PyRun_SimpleString("import threading\n"); + PyEval_InitThreads(); // Create (and acquire) the interpreter lock + PyThreadState *pts = PyGILState_GetThisThreadState(); + PyEval_ReleaseThread(pts); +} + diff --git a/test/standalone/simple/Container_init_python.hxx b/test/standalone/simple/Container_init_python.hxx new file mode 100644 index 00000000..f1f02fee --- /dev/null +++ b/test/standalone/simple/Container_init_python.hxx @@ -0,0 +1,69 @@ +// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +// SALOME Container : implementation of container and engine for Kernel +// File : Container_init_python.hxx +// Author : Paul RASCLE, EDF +// Module : KERNEL +// $Header$ +// +#ifndef _CONTAINER_INIT_PYTHON_HXX_ +#define _CONTAINER_INIT_PYTHON_HXX_ + +//#include "SALOME_Container.hxx" +//#include + +#include // must be before Python.h ! + +#ifdef _XOPEN_SOURCE +#undef _XOPEN_SOURCE +#endif +#ifdef _POSIX_C_SOURCE +#undef _POSIX_C_SOURCE +#endif +#include + + +// next two MACRO must be used together only once inside a block +// ------------------------------------------------------------- +// protect a sequence of Python calls: +// - Python lock must be acquired for these calls +// - new Python thread state allows multi thread use of the sequence: +// - Python may release the lock within the sequence, so multiple +// thread execution of the sequence may occur. +// - For that case, each sequence call must use a specific Python +// thread state. +// - There is no need of C Lock protection of the sequence. + + +#define Py_ACQUIRE_NEW_THREAD \ + PyGILState_STATE gil_state = PyGILState_Ensure(); + +#define Py_RELEASE_NEW_THREAD \ + PyGILState_Release(gil_state); + +struct KERNEL_PYTHON +{ + static void init_python(int argc, char **argv); +}; + +#endif diff --git a/test/standalone/simple/PyInterp.h b/test/standalone/simple/PyInterp.h new file mode 100755 index 00000000..5bfedf34 --- /dev/null +++ b/test/standalone/simple/PyInterp.h @@ -0,0 +1,64 @@ +// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +// File : PyInterp.h +// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com) +// +#if !defined ( PYINTERP_H ) +#define PYINTERP_H + +// ======================================================== +// set dllexport type for Win platform +#ifdef WIN32 +# if defined PYINTERP_EXPORTS || defined PyInterp_EXPORTS +# define PYINTERP_EXPORT __declspec(dllexport) +# else +# define PYINTERP_EXPORT __declspec(dllimport) +# endif +#else // WIN32 +# define PYINTERP_EXPORT +#endif // WIN32 + +// ======================================================== +// little trick - if we do not have debug python libraries +#ifdef _DEBUG + #ifndef HAVE_DEBUG_PYTHON + #undef _DEBUG + #endif +#endif + +#include + +#ifdef _DEBUG + #ifndef HAVE_DEBUG_PYTHON + #define _DEBUG + #endif +#endif + +// ======================================================== +// avoid warning messages +#ifdef WIN32 +#pragma warning (disable : 4786) +#pragma warning (disable : 4251) +#endif + +#endif // PYINTERP_H diff --git a/test/standalone/simple/PyInterp_Utils.h b/test/standalone/simple/PyInterp_Utils.h new file mode 100644 index 00000000..31bbd9f1 --- /dev/null +++ b/test/standalone/simple/PyInterp_Utils.h @@ -0,0 +1,111 @@ +// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// Author : Adrien BRUNETON +// + +#ifndef PYINTERP_UTILS_H +#define PYINTERP_UTILS_H + +#include "PyInterp.h" +#include +#ifdef _DEBUG_ + #include +#endif + +/** + * \class PyLockWrapper + * \brief Python GIL wrapper. + * + * Utility class wrapping the Python GIL acquisition. This makes use of the high level + * API (PyGILState_Ensure and PyGILState_Release), and is hence compatible with only + * one running Python interpreter (no call to Py_NewInterpreter()). + * When the class is instanciated the lock is acquired. It is released at destruction time. + * Copy construction (and hence assignation) is forbidden. + */ +class PYINTERP_EXPORT PyLockWrapper +{ + +public: + /** + * \brief Constructor. Automatically acquires GIL. + */ + PyLockWrapper() + { + _gil_state = PyGILState_Ensure(); + // Save current thread state for later comparison + _state = PyGILState_GetThisThreadState(); + } + + /** + * \brief Destructor. Automatically releases GIL. + */ + ~PyLockWrapper() + { + PyThreadState* _currState = PyGILState_GetThisThreadState(); +#ifdef _DEBUG_ + if (_currState != _state) + { + std::cout << "!!!!!!!!! PyLockWrapper inconsistency - now entering infinite loop for debugging\n"; + while(1); + } +#endif + PyGILState_Release(_gil_state); + } + +private: + PyGILState_STATE _gil_state; + PyThreadState* _state; + + // "Rule of 3" - Forbid usage of copy operator and copy-constructor + PyLockWrapper(const PyLockWrapper & another); + const PyLockWrapper & operator=(const PyLockWrapper & another); +}; + + +/** + * \class PyObjWrapper + * \brief Utility class to properly handle the reference counting required on Python objects. + */ +class PYINTERP_EXPORT PyObjWrapper +{ + PyObject* myObject; +public: + PyObjWrapper(PyObject* theObject) : myObject(theObject) {} + PyObjWrapper() : myObject(0) {} + virtual ~PyObjWrapper() { Py_XDECREF(myObject); } + + operator PyObject*() { return myObject; } + PyObject* operator->() { return myObject; } + PyObject* get() { return myObject; } + bool operator!() { return !myObject; } + bool operator==(PyObject* theObject) { return myObject == theObject; } + PyObject** operator&() { return &myObject; } + PyObjWrapper& operator=(PyObjWrapper* theObjWrapper) + { + Py_XDECREF(myObject); + myObject = theObjWrapper->myObject; + return *this; + } +}; + +#endif + diff --git a/test/standalone/simple/simple_gil.cxx b/test/standalone/simple/simple_gil.cxx new file mode 100644 index 00000000..0fdc6cbe --- /dev/null +++ b/test/standalone/simple/simple_gil.cxx @@ -0,0 +1,61 @@ +// Copyright (C) 2010-2015 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// Author : Adrien Bruneton (CEA) +// +#include +#include +#include +#include "PyInterp_Utils.h" +#include "Container_init_python.hxx" + +#include + +int main(int argc, char ** argv) +{ + // Initialize Python in the way SALOME does: + KERNEL_PYTHON::init_python(argc,argv); + + // The below should always work (illustration of SALOME lock protection) + { + PyLockWrapper lock; // if commented, the below will crash: + + // Nothing important, just a bunch of calls to some Py* functions! + PyRun_SimpleString("import base64"); + PyObject * sysmod = PyImport_AddModule("sys"); + PyObject* sysdict = PyModule_GetDict(sysmod); + PyObject* tmp = PyDict_GetItemString(sysdict, "modules"); + } + std::cout << "Done with Py call" << std::endl; + + // Now the Qt part: + QApplication qtapp(argc, argv); + std::cout << "Done with Qt init" << std::endl; + + // And finally the ParaView part: + pqPVApplicationCore* myCoreApp = new pqPVApplicationCore (argc, argv); + std::cout << "Done with PV init" << std::endl; + // Make sure compilation of ParaView was made with Python support: + if (!myCoreApp->pythonManager()) + return -1; + delete myCoreApp; + + std::cout << "Done with PV deletion" << std::endl; + + return 0; +} diff --git a/test/standalone/src/CMakeLists.txt b/test/standalone/src/CMakeLists.txt deleted file mode 100644 index 3b35cb43..00000000 --- a/test/standalone/src/CMakeLists.txt +++ /dev/null @@ -1,76 +0,0 @@ -# Copyright (C) 2010-2015 CEA/DEN, EDF R&D -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License, or (at your option) any later version. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# -# Author: Adrien Bruneton (CEA) - -SET(pl_HEADERS - PLMainWindow.hxx - PLViewTab.hxx - PVViewer_Behaviors.h - PVViewer_GUIElements.h - ) - -SET(pl_OTHER_HEADERS - PVViewer_Core.h - ) - -SET(pl_SOURCES - main.cpp - PLMainWindow.cxx - PLViewTab.cxx - PVViewer_Behaviors.cxx - PVViewer_GUIElements.cxx - PVViewer_Core.cxx - ) - -SET(pl_FORMS - ui/light_para.ui - ui/view_tab.ui - ) - -SET(CMAKE_INCLUDE_CURRENT_DIR ON) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) -INCLUDE_DIRECTORIES(${PARAVIEW_INCLUDE_DIRS}) - -INCLUDE(${QT_USE_FILE}) -ADD_DEFINITIONS(${QT_DEFINITIONS}) - -# Generate resources that will embedded -SET(ui_resources - "${CMAKE_CURRENT_BINARY_DIR}/LightPara_configuration.qrc") - -GENERATE_QT_RESOURCE_FROM_FILES( - "${ui_resources}" - "/LightPara/Configuration" - "${PROJECT_SOURCE_DIR}/src/xml/ParaViewReaders.xml") - -QT4_ADD_RESOURCES(rcs_sources - ${ui_resources} - ) -QT4_WRAP_UI(pl_FORMS_HEADERS ${pl_FORMS}) -QT4_WRAP_CPP(pl_HEADERS_MOC ${pl_HEADERS}) - -ADD_EXECUTABLE(paraLight - ${pl_SOURCES} - ${pl_HEADERS_MOC} - ${pl_FORMS_HEADERS} - ${rcs_sources}) - -TARGET_LINK_LIBRARIES(paraLight ${QT_LIBRARIES} pqApplicationComponents vtkRenderingFreeTypeOpenGL) -#INSTALL(TARGET paraLight bin) - diff --git a/test/standalone/src/PLMainWindow.cxx b/test/standalone/src/PLMainWindow.cxx deleted file mode 100644 index 7662b16f..00000000 --- a/test/standalone/src/PLMainWindow.cxx +++ /dev/null @@ -1,272 +0,0 @@ -// Copyright (C) 2010-2015 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// -// Author: Adrien Bruneton (CEA) - -#include "PVViewer_GUIElements.h" -#include "PLMainWindow.hxx" -#include "PVViewer_Core.h" -#include "PLViewTab.hxx" - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -PLMainWindow::PLMainWindow(QWidget *parent) : - QMainWindow(parent), - _pAppC(0), - _simplePipeline(), - _autoApply(true) -{ - _mainWindow.setupUi(this); - _autoApply = _mainWindow.actionAuto_apply->isChecked(); - QObject::connect(this, SIGNAL(apply()), this, SLOT(onApply())); - QObject::connect(this, SIGNAL(changedCurrentFile(QString)), this, SLOT(onApply())); - addTab(); -} - -// Called after ParaView application initialisation: -void PLMainWindow::finishUISetup() -{ - _pAppC = PVViewer_Core::GetPVApplication(); - PVViewer_GUIElements * pvgui = PVViewer_GUIElements::GetInstance(this); - QWidget * wprop = pvgui->getPropertiesPanel(); - QWidget * wpipe = pvgui->getPipelineBrowserWidget(); - wprop->setParent(_mainWindow.propFrame); - _mainWindow.verticalLayoutProp->addWidget(wprop); - wpipe->setParent(_mainWindow.pipelineFrame); - _mainWindow.verticalLayoutPipe->addWidget(wpipe); - - PVViewer_GUIElements * pvge = PVViewer_GUIElements::GetInstance(this); -// pvge->setToolBarVisible(false); - - // In this mockup, we play on the parent widget visibility (a QFrame), so show these: - pvge->getPipelineBrowserWidget()->show(); - pvge->getPropertiesPanel()->show(); - // and hide these: - _mainWindow.propFrame->hide(); - _mainWindow.pipelineFrame->hide(); -// pvge->setToolBarEnabled(false); -// pvge->setToolBarVisible(false); - -} - -void PLMainWindow::autoApplyCheck(bool isChecked) -{ - _autoApply = isChecked; -} - -void PLMainWindow::onApply() -{ - if (_autoApply) - { - PVViewer_GUIElements * pvgui = PVViewer_GUIElements::GetInstance(this); - pqPropertiesPanel * wprop = pvgui->getPropertiesPanel(); - wprop->apply(); - } -} - -void PLMainWindow::showProp(bool isChecked) -{ - isChecked ? _mainWindow.propFrame->show() : _mainWindow.propFrame->hide(); -} - -void PLMainWindow::showPipeline(bool isChecked) -{ - isChecked ? _mainWindow.pipelineFrame->show() : _mainWindow.pipelineFrame->hide(); -} - -void PLMainWindow::addTab() -{ - int c = _mainWindow.tabWidget->count(); - PLViewTab * newTab = new PLViewTab(_mainWindow.tabWidget); - int newIdx = _mainWindow.tabWidget->addTab(newTab, QString("Tab %1").arg(c+1)); - _mainWindow.tabWidget->setCurrentIndex(newIdx); - - // Connect buttons - QObject::connect(newTab, SIGNAL(onInsertSingleView(PLViewTab *)), this, SLOT(insertSingleView(PLViewTab *))); - QObject::connect(newTab, SIGNAL(onInsertMultiView(PLViewTab *)), this, SLOT(insertMultiView(PLViewTab *))); -} - -void PLMainWindow::deleteTab() -{ - int c = _mainWindow.tabWidget->currentIndex(); - if (c != -1) - { - _mainWindow.tabWidget->removeTab(c); - } -} - -void PLMainWindow::currentTabChanged(int tabIdx) -{ - QWidget * w = _mainWindow.tabWidget->widget(tabIdx); - if (w) - { - PLViewTab * viewtab = qobject_cast(w); - if (viewtab && viewtab->getpqView()) - { - pqActiveObjects::instance().setActiveView(viewtab->getpqView()); - } - } -} - -void PLMainWindow::doOpenFile() -{ - // Clean up vizu -// cleanAll(); - - // Load the stuff as wireframe in the main view: - QList many = pqLoadDataReaction::loadData(); - if (many.isEmpty()) - { - std::cout << "no file selected!" << std::endl; - return; - } - if (many.count() > 1) - { - QMessageBox msgBox; - msgBox.setText("Select one file only!"); - msgBox.exec(); - cleanAll(); - return; - } - - pqPipelineSource * src = many.at(0); - std::cout << "num of out ports: " << src->getNumberOfOutputPorts() << std::endl; - - // A cone to start with: -// pqPipelineSource * src = this->_pAppC->getObjectBuilder()->createSource(QString("sources"), QString("ConeSource"), -// this->_activeServer); - if(src) - _simplePipeline.push(src); - - // Retrieve loaded file name - vtkSMProperty * prop = src->getSourceProxy()->GetProperty("FileName"); - vtkSMStringVectorProperty * prop2 = vtkSMStringVectorProperty::SafeDownCast(prop); - QString fName(prop2->GetElement(0)); - - // Emit signal - emit changedCurrentFile(fName); -} - -void PLMainWindow::insertSingleView(PLViewTab * tab) -{ - // Create a new view proxy on the server - pqObjectBuilder* builder = _pAppC->getObjectBuilder(); - pqServer* active_serv = pqActiveObjects::instance().activeServer(); - - std::cout << "About to create single view ..." << std::endl; - pqView * pqview = builder->createView(QString("RenderView"), active_serv); - std::cout << "Created: " << pqview << "!" << std::endl; - - // Retrieve its widget and pass it to the Qt tab: - QWidget* viewWidget = pqview->getWidget(); - -// QWidget* viewWidget = new QPushButton("toto"); - tab->hideAndReplace(viewWidget, pqview); - - pqActiveObjects::instance().setActiveView(pqview); -} - -void PLMainWindow::insertMultiView(PLViewTab * tab) -{ - // Retrieve TabbedMultiView and see if it is already attached to someone: - PVViewer_GUIElements * pvgui = PVViewer_GUIElements::GetInstance(this); - pqTabbedMultiViewWidget * multiv = pvgui->getTabbedMultiViewWidget(); - - QWidget * parent = multiv->nativeParentWidget(); - if (parent) - { - QMessageBox msgBox; - msgBox.setText("Multi-view already in use in another tab! Close it first."); - msgBox.exec(); - } - else - { - tab->hideAndReplace(multiv, NULL); - } -} - - -void PLMainWindow::doShrink() -{ - if(!_simplePipeline.isEmpty()) - { - cleanAllButSource(); - - pqPipelineSource * src = this->_pAppC->getObjectBuilder()->createFilter(QString("filters"), - QString("ShrinkFilter"), _simplePipeline.top()); - if(src) - _simplePipeline.push(src); - - // Hit apply - emit apply(); - } -} - -void PLMainWindow::doSlice() -{ - if(!_simplePipeline.isEmpty()) - { - cleanAllButSource(); - - pqPipelineSource * src = this->_pAppC->getObjectBuilder()->createFilter(QString("filters"), - QString("Cut"), _simplePipeline.top()); - if(src) - _simplePipeline.push(src); - - // Hit apply - emit apply(); - } -} - -void PLMainWindow::doManagePlugins() -{ - pqManagePluginsReaction::managePlugins(); -} - -void PLMainWindow::cleanAll() -{ - this->_pAppC->getObjectBuilder()->destroyPipelineProxies(); - _simplePipeline.resize(0); -} - -void PLMainWindow::cleanAllButSource() -{ - while(_simplePipeline.size() > 1) - this->_pAppC->getObjectBuilder()->destroy(_simplePipeline.pop()); -} diff --git a/test/standalone/src/PLMainWindow.hxx b/test/standalone/src/PLMainWindow.hxx deleted file mode 100644 index 2fee621a..00000000 --- a/test/standalone/src/PLMainWindow.hxx +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (C) 2010-2015 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// -// Author: Adrien Bruneton (CEA) - -#ifndef PLVIEWWIDGET_H_ -#define PLVIEWWIDGET_H_ - -#include -#include "ui_light_para.h" -#include - -class pqPVApplicationCore; -class pqPipelineSource; -class pqServer; -class pqProxy; - -class PLViewTab; - -/** Main window of the application. - */ -class PLMainWindow: public QMainWindow { - Q_OBJECT - -public: - PLMainWindow(QWidget * parent=0); - virtual ~PLMainWindow() {} - - void finishUISetup(); - -protected: - void doOpenFile(); - void doManagePlugins(); - - void doSlice(); - void doShrink(); - - void cleanAll(); - void cleanAllButSource(); - -signals: - void changedCurrentFile(QString fileName); - void apply(); // convenience signal to forward to the real ParaView apply - -private slots: - void autoApplyCheck(bool); - void onApply(); - void showPipeline(bool); - void showProp(bool); - - void addTab(); - void deleteTab(); - - void onFileOpen() { doOpenFile(); }; - void slice() { doSlice(); }; - void shrink() { doShrink(); }; - void managePlugins() { doManagePlugins(); }; - - void insertSingleView(PLViewTab *); - void insertMultiView(PLViewTab *); - - void currentTabChanged(int); - -private: - Ui::MainWindow _mainWindow; - - pqPVApplicationCore * _pAppC; - //pqServer * _activeServer; - //pqPipelineSource * _activeSource; // last pipeline element - QStack _simplePipeline; - - bool _autoApply; -}; - -#endif /* PLVIEWWIDGET_H_ */ diff --git a/test/standalone/src/PLViewTab.cxx b/test/standalone/src/PLViewTab.cxx deleted file mode 100644 index 6ee1fd2f..00000000 --- a/test/standalone/src/PLViewTab.cxx +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (C) 2010-2015 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// -// Author: Adrien Bruneton (CEA) - -#include -#include "PLViewTab.hxx" - -PLViewTab::PLViewTab(QWidget * parent): -QWidget(parent), -_renderView(0) -{ - _viewTab.setupUi(this); -} - -void PLViewTab::insertSingleView() -{ - emit onInsertSingleView(this); -} - -void PLViewTab::insertMultiView() -{ - emit onInsertMultiView(this); -} - -void PLViewTab::hideAndReplace(QWidget * w, pqView * view) -{ - _viewTab.frameButtons->hide(); - w->setParent(_viewTab.frameView); - QVBoxLayout * vbox = _viewTab.verticalLayoutView; - vbox->addWidget(w); - _renderView = view; -} - -void PLViewTab::viewDestroyed() -{ - std::cout << "View destroyed!" << std::endl; -} - diff --git a/test/standalone/src/PLViewTab.hxx b/test/standalone/src/PLViewTab.hxx deleted file mode 100644 index c6f5cb13..00000000 --- a/test/standalone/src/PLViewTab.hxx +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (C) 2010-2015 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// -// Author: Adrien Bruneton (CEA) - -#ifndef SRC_PLVIEWTAB_HXX_ -#define SRC_PLVIEWTAB_HXX_ - -#include "ui_view_tab.h" - -class pqView; - -/** Widget inserted when a new tab is requested in the application. - */ -class PLViewTab: public QWidget { - Q_OBJECT - -public: - PLViewTab(QWidget * parent=0); - virtual ~PLViewTab() {} - - // Hide buttons, and put widget in the QFrame with a vertical layout - void hideAndReplace(QWidget * w, pqView * view); - - pqView * getpqView() { return _renderView; } - -private slots: - void insertSingleView(); - void insertMultiView(); - void viewDestroyed(); - -signals: - void onInsertSingleView(PLViewTab *); - void onInsertMultiView(PLViewTab *); - -private: - Ui::ViewTab _viewTab; - pqView * _renderView; -}; - -#endif /* SRC_PLVIEWTAB_HXX_ */ diff --git a/test/standalone/src/PVViewer_Behaviors.cxx b/test/standalone/src/PVViewer_Behaviors.cxx deleted file mode 100644 index fefe75e5..00000000 --- a/test/standalone/src/PVViewer_Behaviors.cxx +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (C) 2010-2015 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// -// Author: Adrien Bruneton (CEA) - -#include "PVViewer_Behaviors.h" - -#include - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -int PVViewer_Behaviors::BehaviorLoadingLevel = 0; - -PVViewer_Behaviors::PVViewer_Behaviors(QMainWindow * parent) - : QObject(parent) -{ -} - -/**! Instanciate minimal ParaView behaviors needed when using an instance of PVViewer. - * This method should be updated at each new version of ParaView with what is found in - * Qt/ApplicationComponents/pqParaViewBehaviors.cxx - */ -void PVViewer_Behaviors::instanciateMinimalBehaviors(QMainWindow * desk) -{ - if (BehaviorLoadingLevel < 1) - { - // Register ParaView interfaces. - pqInterfaceTracker* pgm = pqApplicationCore::instance()->interfaceTracker(); - - // Register standard types of property widgets. - pgm->addInterface(new pqStandardPropertyWidgetInterface(pgm)); - // Register standard types of view-frame actions. - pgm->addInterface(new pqStandardViewFrameActionsImplementation(pgm)); - - // Load plugins distributed with application. - pqApplicationCore::instance()->loadDistributedPlugins(); - - new pqDefaultViewBehavior(this); // shows a 3D view as soon as a server connection is made - new pqAlwaysConnectedBehavior(this); // client always connected to a server - new pqVerifyRequiredPluginBehavior(this); - new pqPluginSettingsBehavior(this); - new pqFixPathsInStateFilesBehavior(this); - new pqCrashRecoveryBehavior(this); - new pqCommandLineOptionsBehavior(this); - - BehaviorLoadingLevel = 1; - } -} - -/**! Instanciate usual ParaView behaviors. - * This method should be updated at each new version of ParaView with what is found in - * Qt/ApplicationComponents/pqParaViewBehaviors.cxx - */ -void PVViewer_Behaviors::instanciateAllBehaviors(QMainWindow * desk) -{ - // "new pqParaViewBehaviors(anApp->desktop(), this);" - // -> (which loads all standard ParaView behaviors at once) has to be replaced in order to - // exclude using of pqQtMessageHandlerBehaviour - - // Define application behaviors. - if (BehaviorLoadingLevel < 1) - instanciateMinimalBehaviors(desk); - - if (BehaviorLoadingLevel < 2) - { - //new pqQtMessageHandlerBehavior(this); // THIS ONE TO EXCLUDE !! see comment above - new pqDataTimeStepBehavior(this); - new pqSpreadSheetVisibilityBehavior(this); - new pqPipelineContextMenuBehavior(this); - new pqUndoRedoBehavior(this); - new pqAutoLoadPluginXMLBehavior(this); // auto load plugins GUI stuff - new pqPluginDockWidgetsBehavior(desk); - new pqPluginActionGroupBehavior(desk); - new pqPersistentMainWindowStateBehavior(desk); - new pqObjectPickingBehavior(desk); - new pqCollaborationBehavior(this); - new pqViewStreamingBehavior(this); - - pqApplyBehavior* applyBehavior = new pqApplyBehavior(this); - foreach (pqPropertiesPanel* ppanel, desk->findChildren()) - { - applyBehavior->registerPanel(ppanel); - } - BehaviorLoadingLevel = 2; - } -} diff --git a/test/standalone/src/PVViewer_Behaviors.h b/test/standalone/src/PVViewer_Behaviors.h deleted file mode 100644 index 7b6c9cfa..00000000 --- a/test/standalone/src/PVViewer_Behaviors.h +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (C) 2010-2015 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// -// Author: Adrien Bruneton (CEA) - - -#ifndef PVGUIBEHAVIORS_H_ -#define PVGUIBEHAVIORS_H_ - -#include - -class QMainWindow; -class pqPropertiesPanel; - -/**! - * PARAVIS behaviors - mimic what is done in - * Qt/ApplicationComponents/pqParaViewBehaviors.cxx - * Except a few ones, behaviors are destroyed when the module is destroyed. - */ -class PVViewer_Behaviors: public QObject -{ - Q_OBJECT - -public: - PVViewer_Behaviors(QMainWindow * parent); - - void instanciateMinimalBehaviors(QMainWindow * desk); - void instanciateAllBehaviors(QMainWindow * desk); - - virtual ~PVViewer_Behaviors() {} - -private: - static int BehaviorLoadingLevel; -}; - -#endif /* PVGUIBEHAVIORS_H_ */ diff --git a/test/standalone/src/PVViewer_Core.cxx b/test/standalone/src/PVViewer_Core.cxx deleted file mode 100644 index 319179cf..00000000 --- a/test/standalone/src/PVViewer_Core.cxx +++ /dev/null @@ -1,140 +0,0 @@ -// Copyright (C) 2010-2015 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// -// Author : Adrien Bruneton (CEA) -// - -#include "PVViewer_Core.h" -//#include "PVViewer_LogWindowAdapter.h" -#include "PVViewer_GUIElements.h" -#include "PVViewer_Behaviors.h" -#include "PVViewer_Core.h" - -#include -#include -#include -#include - -#include - -#include -#include -#include -#include -#include -#include -#include -#include - - -//---------- Static init ----------------- -pqPVApplicationCore* PVViewer_Core::MyCoreApp = 0; -bool PVViewer_Core::ConfigLoaded = false; -PVViewer_Behaviors * PVViewer_Core::ParaviewBehaviors = NULL; - -pqPVApplicationCore * PVViewer_Core::GetPVApplication() -{ - return MyCoreApp; -} - -/*! - \brief Static method, performs initialization of ParaView session. - \param fullSetup whether to instanciate all behaviors or just the minimal ones. - \return \c true if ParaView has been initialized successfully, otherwise false -*/ -bool PVViewer_Core::ParaviewInitApp(QMainWindow * aDesktop, LogWindow * logWindow) -{ - if ( ! MyCoreApp) { - // Obtain command-line arguments - int argc = 0; - char** argv = 0; - QString aOptions = getenv("PARAVIEW_OPTIONS"); - QStringList aOptList = aOptions.split(":", QString::SkipEmptyParts); - argv = new char*[aOptList.size() + 1]; - QStringList args = QApplication::arguments(); - argv[0] = (args.size() > 0)? strdup(args[0].toLatin1().constData()) : strdup("paravis"); - argc++; - - foreach (QString aStr, aOptList) { - argv[argc] = strdup( aStr.toLatin1().constData() ); - argc++; - } - MyCoreApp = new pqPVApplicationCore (argc, argv); - if (MyCoreApp->getOptions()->GetHelpSelected() || - MyCoreApp->getOptions()->GetUnknownArgument() || - MyCoreApp->getOptions()->GetErrorMessage() || - MyCoreApp->getOptions()->GetTellVersion()) { - return false; - } - - // Direct VTK log messages to our SALOME window - TODO: review this -// PVViewer_LogWindowAdapter * w = PVViewer_LogWindowAdapter::New(); -// w->setLogWindow(logWindow); -// vtkOutputWindow::SetInstance(w); - -// new pqTabbedMultiViewWidget(); // registers a "MULTIVIEW_WIDGET" on creation - - for (int i = 0; i < argc; i++) - free(argv[i]); - delete[] argv; - } - // Initialize GUI elements if needed: - PVViewer_GUIElements::GetInstance(aDesktop); - return true; -} - -void PVViewer_Core::ParaviewInitBehaviors(bool fullSetup, QMainWindow* aDesktop) -{ - if (!ParaviewBehaviors) - ParaviewBehaviors = new PVViewer_Behaviors(aDesktop); - - if(fullSetup) - ParaviewBehaviors->instanciateAllBehaviors(aDesktop); - else - ParaviewBehaviors->instanciateMinimalBehaviors(aDesktop); -} - -void PVViewer_Core::ParaviewLoadConfigurations(const QString & configPath, bool force) -{ - if (!ConfigLoaded || force) - { - if (!configPath.isNull()) { - MyCoreApp->loadConfiguration(configPath + QDir::separator() + "ParaViewFilters.xml"); - MyCoreApp->loadConfiguration(configPath + QDir::separator() + "ParaViewSources.xml"); - } - ConfigLoaded = true; - } -} - -void PVViewer_Core::ParaviewCleanup() -{ - // Disconnect from server - pqServer* server = pqActiveObjects::instance().activeServer(); - if (server && server->isRemote()) - { - pqServerDisconnectReaction::disconnectFromServer(); - } - - pqApplicationCore::instance()->settings()->sync(); - - pqPVApplicationCore * app = GetPVApplication(); - // Schedule destruction of PVApplication singleton: - if (app) - app->deleteLater(); -} - diff --git a/test/standalone/src/PVViewer_Core.h b/test/standalone/src/PVViewer_Core.h deleted file mode 100644 index b8e96c85..00000000 --- a/test/standalone/src/PVViewer_Core.h +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (C) 2010-2015 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// -// Author : Adrien Bruneton (CEA) - -#ifndef SRC_PVVIEWER_PVVIEWER_CORE_H_ -#define SRC_PVVIEWER_PVVIEWER_CORE_H_ - -#include - -class PVServer_ServiceWrapper; -class PVViewer_Behaviors; -class LogWindow; -class QMainWindow; -class pqPVApplicationCore; - -/** - Pure static class gathering most of the interactions with ParaView's API and ParaView's - start sequence. - */ -class PVViewer_Core -{ -public: - static pqPVApplicationCore * GetPVApplication(); - - - //! Initialize ParaView if not yet done (once per session) - static bool ParaviewInitApp(QMainWindow* aDesktop, LogWindow * w); - static void ParaviewInitBehaviors(bool fullSetup=false, QMainWindow* aDesktop=0); - static void ParaviewLoadConfigurations(const QString & configPath, bool force=false); - static void ParaviewCleanup(); - -private: - PVViewer_Core(); - virtual ~PVViewer_Core(); - - static pqPVApplicationCore* MyCoreApp; - static bool ConfigLoaded; - static PVViewer_Behaviors * ParaviewBehaviors; -}; - -#endif /* SRC_PVVIEWER_PVVIEWER_CORE_H_ */ diff --git a/test/standalone/src/PVViewer_GUIElements.cxx b/test/standalone/src/PVViewer_GUIElements.cxx deleted file mode 100644 index e008c225..00000000 --- a/test/standalone/src/PVViewer_GUIElements.cxx +++ /dev/null @@ -1,245 +0,0 @@ -// Copyright (C) 2010-2015 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// -// Author: Adrien Bruneton (CEA) - -#include - -#include "PVViewer_GUIElements.h" -#include "PVViewer_Core.h" - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include -#include -#include - -#include - -PVViewer_GUIElements * PVViewer_GUIElements::theInstance = 0; - -PVViewer_GUIElements::PVViewer_GUIElements(QMainWindow* desk) : - propertiesPanel(0), pipelineBrowserWidget(0), - sourcesMenu(0) -{ - propertiesPanel = new pqPropertiesPanel(desk); - propertiesPanel->hide(); - pipelineBrowserWidget = new pqPipelineBrowserWidget(desk); - pipelineBrowserWidget->hide(); - - sourcesMenu = new QMenu(0); - pqParaViewMenuBuilders::buildSourcesMenu(*sourcesMenu, desk); - filtersMenu = new QMenu(0); - pqParaViewMenuBuilders::buildFiltersMenu(*filtersMenu, desk); - macrosMenu = new QMenu(0); - pqParaViewMenuBuilders::buildMacrosMenu(*macrosMenu); - - //myBuildToolbars(desk); -} - -PVViewer_GUIElements * PVViewer_GUIElements::GetInstance(QMainWindow* desk) -{ - if (! theInstance) - theInstance = new PVViewer_GUIElements(desk); - return theInstance; -} - - -pqTabbedMultiViewWidget * PVViewer_GUIElements::getTabbedMultiViewWidget() -{ - pqTabbedMultiViewWidget * multiv = - qobject_cast(PVViewer_Core::GetPVApplication()->manager("MULTIVIEW_WIDGET")); - - // If not found, instanciate it. It will then register automatically as a MULTIVIEW_WIDGET. - // Also create a single view that will be attached by the tabbedMultiView automatically - // (in PV this is done automatically upon server connection event). - if (!multiv) - { - multiv = new pqTabbedMultiViewWidget(); - - // Create a new view proxy on the server - pqObjectBuilder* builder = pqApplicationCore::instance()->getObjectBuilder(); - pqServer* active_serv = pqActiveObjects::instance().activeServer(); - pqView * pqview = builder->createView(QString("RenderView"), active_serv); - } - - return multiv; -} - - -/** - * See ParaView source code: pqParaViewMenuBuilders::buildToolbars() - * to keep this function up to date: - */ -void PVViewer_GUIElements::myBuildToolbars(QMainWindow* mainWindow) -{ - mainToolBar = new pqMainControlsToolbar(mainWindow) - << pqSetName("MainControlsToolbar"); - mainToolBar->layout()->setSpacing(0); - - vcrToolbar = new pqVCRToolbar(mainWindow) - << pqSetName("VCRToolbar"); - vcrToolbar->layout()->setSpacing(0); - - timeToolbar = new pqAnimationTimeToolbar(mainWindow) - << pqSetName("currentTimeToolbar"); - timeToolbar->layout()->setSpacing(0); - - colorToolbar = new pqColorToolbar(mainWindow) - << pqSetName("variableToolbar"); - colorToolbar->layout()->setSpacing(0); - - reprToolbar = new pqRepresentationToolbar(mainWindow) - << pqSetName("representationToolbar"); - reprToolbar->layout()->setSpacing(0); - - cameraToolbar = new pqCameraToolbar(mainWindow) - << pqSetName("cameraToolbar"); - cameraToolbar->layout()->setSpacing(0); - - axesToolbar = new pqAxesToolbar(mainWindow) - << pqSetName("axesToolbar"); - axesToolbar->layout()->setSpacing(0); - - // Give the macros menu to the pqPythonMacroSupervisor - pqPythonManager* manager = qobject_cast( - pqApplicationCore::instance()->manager("PYTHON_MANAGER")); - - macrosToolbar = new QToolBar("Macros Toolbars", mainWindow) - << pqSetName("MacrosToolbar"); - manager->addWidgetForRunMacros(macrosToolbar); - - commonToolbar = new QToolBar("Common", mainWindow) << pqSetName("Common"); - commonToolbar->layout()->setSpacing(0); - - dataToolbar = new QToolBar("DataAnalysis", mainWindow) << pqSetName("DataAnalysis"); - dataToolbar->layout()->setSpacing(0); - - //addToolbars(mainWindow); -} - -void PVViewer_GUIElements::setToolBarVisible(bool show) -{ - QCoreApplication::processEvents(); - mainAction->setChecked(!show); - mainAction->setVisible(show); - mainAction->trigger(); - vcrAction->setChecked(!show); - vcrAction->setVisible(show); - vcrAction->trigger(); - timeAction->setChecked(!show); - timeAction->setVisible(show); - timeAction->trigger(); - colorAction->setChecked(!show); - colorAction->setVisible(show); - colorAction->trigger(); - reprAction->setChecked(!show); - reprAction->setVisible(show); - reprAction->trigger(); - cameraAction->setChecked(!show); - cameraAction->setVisible(show); - cameraAction->trigger(); - axesAction->setChecked(!show); - axesAction->setVisible(show); - axesAction->trigger(); - macrosAction->setChecked(!show); - macrosAction->setVisible(show); - macrosAction->trigger(); - commonAction->setChecked(!show); - commonAction->setVisible(show); - commonAction->trigger(); - dataAction->setChecked(!show); - dataAction->setVisible(show); - dataAction->trigger(); -} - -void PVViewer_GUIElements::addToolbars(QMainWindow* desk) -{ - desk->addToolBar(Qt::TopToolBarArea, mainToolBar); - desk->addToolBar(Qt::TopToolBarArea, vcrToolbar); - desk->addToolBar(Qt::TopToolBarArea, timeToolbar); - desk->addToolBar(Qt::TopToolBarArea, colorToolbar); - desk->insertToolBarBreak(colorToolbar); - desk->addToolBar(Qt::TopToolBarArea, reprToolbar); - desk->addToolBar(Qt::TopToolBarArea, cameraToolbar); - desk->addToolBar(Qt::TopToolBarArea, axesToolbar); - desk->addToolBar(Qt::TopToolBarArea, macrosToolbar); - desk->addToolBar(Qt::TopToolBarArea, commonToolbar); - desk->addToolBar(Qt::TopToolBarArea, dataToolbar); - - mainAction = mainToolBar->toggleViewAction(); - vcrAction = vcrToolbar->toggleViewAction(); - timeAction = timeToolbar->toggleViewAction(); - colorAction = colorToolbar->toggleViewAction(); - reprAction = reprToolbar->toggleViewAction(); - cameraAction = cameraToolbar->toggleViewAction(); - axesAction = axesToolbar->toggleViewAction(); - macrosAction = macrosToolbar->toggleViewAction(); - commonAction = commonToolbar->toggleViewAction(); - dataAction = dataToolbar->toggleViewAction(); -} - -void PVViewer_GUIElements::onEmulateApply() -{ - if (propertiesPanel) - propertiesPanel->apply(); -} - -QList PVViewer_GUIElements::getToolbars() -{ - QList l; - l << mainToolBar << vcrToolbar << timeToolbar << colorToolbar - << reprToolbar << cameraToolbar << axesToolbar << macrosToolbar - << commonToolbar << dataToolbar; - return l; -} - -void PVViewer_GUIElements::setToolBarEnabled(bool enabled) -{ - mainToolBar ->setEnabled(enabled); - vcrToolbar ->setEnabled(enabled); - timeToolbar ->setEnabled(enabled); - colorToolbar ->setEnabled(enabled); - reprToolbar ->setEnabled(enabled); - cameraToolbar->setEnabled(enabled); - axesToolbar ->setEnabled(enabled); - macrosToolbar->setEnabled(enabled); - commonToolbar->setEnabled(enabled); - dataToolbar ->setEnabled(enabled); -} diff --git a/test/standalone/src/PVViewer_GUIElements.h b/test/standalone/src/PVViewer_GUIElements.h deleted file mode 100644 index 33afc038..00000000 --- a/test/standalone/src/PVViewer_GUIElements.h +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright (C) 2010-2015 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// -// Author: Adrien Bruneton (CEA) - -#ifndef PVVIEWERGUIELEMENTS_H_ -#define PVVIEWERGUIELEMENTS_H_ - -#include -#include - -class pqPropertiesPanel; -class pqPipelineBrowserWidget; -class pqTabbedMultiViewWidget; -class QMainWindow; -class QMenu; -class QToolBar; -class QAction; -class pqAnimationTimeToolbar; -class pqVCRToolbar; - -/*! - * Some GUI elements of ParaView need to be instanciated in a proper order. This class - * holds all of them for the sake of clarity. - */ -class PVViewer_GUIElements: public QObject -{ - Q_OBJECT - -public: - static PVViewer_GUIElements * GetInstance(QMainWindow * desk); - - pqPropertiesPanel * getPropertiesPanel() { return propertiesPanel; } - pqPipelineBrowserWidget * getPipelineBrowserWidget() { return pipelineBrowserWidget; } - pqTabbedMultiViewWidget * getTabbedMultiViewWidget(); - - QMenu* getFiltersMenu() { return filtersMenu; } - QMenu* getSourcesMenu() { return sourcesMenu; } - QMenu* getMacrosMenu() { return macrosMenu; } - - pqVCRToolbar* getVCRToolbar() { return vcrToolbar; } - pqAnimationTimeToolbar* getTimeToolbar() { return timeToolbar; } - - void myBuildToolbars(QMainWindow* desk); - void addToolbars(QMainWindow* desk); - void setToolBarVisible(bool show); - void setToolBarEnabled(bool enabled); - QList getToolbars(); - -public slots: - void onEmulateApply(); // better use the slot from PVViewer_ViewManager if you want to trigger "Apply" - -private: - PVViewer_GUIElements(QMainWindow* desk); - virtual ~PVViewer_GUIElements() {} - - static PVViewer_GUIElements* theInstance; - - // Widgets - pqPropertiesPanel* propertiesPanel; - pqPipelineBrowserWidget* pipelineBrowserWidget; - pqTabbedMultiViewWidget* tabbedMultiViewWidget; - - // Dummy QMenus receiving ParaView's reaction for automatic add when new sources are added - QMenu* sourcesMenu; - QMenu* filtersMenu; - QMenu* macrosMenu; - - // Toolbars also need to be instanciated early: - QToolBar* mainToolBar; - pqVCRToolbar* vcrToolbar; - pqAnimationTimeToolbar* timeToolbar; - QToolBar* colorToolbar; - QToolBar* reprToolbar; - QToolBar* cameraToolbar; - QToolBar* axesToolbar; - QToolBar* macrosToolbar; - QToolBar* commonToolbar; - QToolBar* dataToolbar; - -public: - QAction* mainAction; - QAction* vcrAction; - QAction* timeAction; - QAction* colorAction; - QAction* reprAction; - QAction* cameraAction; - QAction* axesAction; - QAction* macrosAction; - QAction* commonAction; - QAction* dataAction; -}; - -#endif /* PVVIEWERGUIELEMENTS_H_ */ diff --git a/test/standalone/src/README.txt b/test/standalone/src/README.txt deleted file mode 100644 index 9dd99191..00000000 --- a/test/standalone/src/README.txt +++ /dev/null @@ -1,15 +0,0 @@ -This light application was built to mimick the key elements at hand -when integrating ParaView into SALOME (i.e. when designing PARAVIS). - -Notably the following classes are (almost) a copy/paste of what is -found in the PVViewer subfolder of GUI: - PVViewer_Core - PVViewer_GUIElements - PVViewer_Behaviors - -The application should have a boot sequence similar to the start-up -of the PVViewer in SALOME, or to the activation of the PARAVIS module. - -The main executable is called - paraLight -and is *not* installed (it can be executed from the build directory). diff --git a/test/standalone/src/main.cpp b/test/standalone/src/main.cpp deleted file mode 100644 index c8bf7632..00000000 --- a/test/standalone/src/main.cpp +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (C) 2010-2015 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// -// Author: Adrien Bruneton (CEA) - -#include - -#include "PVViewer_Core.h" -#include "PVViewer_Behaviors.h" -#include "PLMainWindow.hxx" - -#include -#include -#include -#include -#include -#include - -int main(int argc, char ** argv) -{ - std::cout << "Starting LightParaView ..." << std::endl; - - std::cout << "Init Qt app ..." << std::endl; - QApplication qtapp(argc, argv); - QApplication::setApplicationName("LightPara"); - - std::cout << "Create Qt main window ..." << std::endl; - PLMainWindow * para_widget = new PLMainWindow(); - - std::cout << "Init appli core ..." << std::endl; - PVViewer_Core::ParaviewInitApp(para_widget, NULL); - - std::cout << "Binding ParaView widget in QMainWindow ..." << std::endl; - para_widget->finishUISetup(); - - /* Install event filter */ -// std::cout << "Install event filter ..." << std::endl; -// pqPVApplicationCore * plApp = PVViewer_Core::GetPVApplication(); -// QApplication::instance()->installEventFilter(plApp); - - std::cout << "Init behaviors ..." << std::endl; - PVViewer_Core::ParaviewInitBehaviors(true, para_widget); - - //para_widget->updateActiveServer(); - - //std::cout << "Load config ..." << std::endl; - //PVViewer_Core::ParaviewLoadConfigurations(QString(":/LightPara/Configuration/")); - - /* Inspired from ParaView source code: - * leave time for the GUI to update itself before displaying the main window: */ - QApplication::instance()->processEvents(); - - // Try to connect -// std::cout << "about to try to connect ...\n"; -// const char * server_url = "cs://localhost"; -// if (!pqServerConnectReaction::connectToServer(pqServerResource(server_url))) -// { -// std::cerr << "Could not connect to requested server \"" -// << server_url << "\". Creating default builtin connection.\n"; -// } - - /* ... and GO: */ - std::cout << "Show !" << std::endl; - para_widget->show(); - int ret_code = qtapp.exec(); - - /* then disconnect and leave nicely */ - //pqServerDisconnectReaction::disconnectFromServer(); - - std::cout << "Clean up ..." << std::endl; - PVViewer_Core::ParaviewCleanup(); - - delete para_widget; - - std::cout << "Done." << std::endl; - return ret_code; -} - - - diff --git a/test/standalone/src/ui/light_para.ui b/test/standalone/src/ui/light_para.ui deleted file mode 100644 index 47c38e3a..00000000 --- a/test/standalone/src/ui/light_para.ui +++ /dev/null @@ -1,654 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 1010 - 678 - - - - PARAVIS Light! - - - - - - - Qt::Horizontal - - - - Qt::Vertical - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - - - - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - - - - - - - - -1 - - - - - - - - - - Chosen file: - - - - - - - true - - - - - - - Open ... - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Add tab ... - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Delete current tab - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Manage Plugins ... - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Slice - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Shrink - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Quit - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - 0 - 0 - 1010 - 22 - - - - - File - - - - - - - Simple actions - - - - - - - Tabs - - - - - - - Options - - - - - - - - - - - - - - Open file ... - - - - - Quit - - - - - Slice - - - - - Shrink - - - - - Add tab - - - - - Delete tab - - - - - true - - - true - - - Auto apply - - - - - true - - - false - - - Show prop widget - - - - - true - - - false - - - Show pipeline - - - - - - - quitButton - clicked() - MainWindow - close() - - - 871 - 588 - - - 439 - 210 - - - - - openButton - clicked() - MainWindow - onFileOpen() - - - 1004 - 271 - - - 456 - 258 - - - - - MainWindow - changedCurrentFile(QString) - currentFileLabel - setText(QString) - - - 456 - 258 - - - 211 - 259 - - - - - shrinkButton - clicked() - MainWindow - shrink() - - - 674 - 588 - - - 456 - 258 - - - - - sliceButton - clicked() - MainWindow - slice() - - - 472 - 588 - - - 504 - 338 - - - - - pluginsButton - clicked() - MainWindow - managePlugins() - - - 279 - 588 - - - 504 - 338 - - - - - actionSlice - triggered() - MainWindow - slice() - - - -1 - -1 - - - 504 - 338 - - - - - actionShrink - triggered() - MainWindow - shrink() - - - -1 - -1 - - - 504 - 338 - - - - - actionOpen_file - triggered() - MainWindow - onFileOpen() - - - -1 - -1 - - - 504 - 338 - - - - - actionQuit - triggered() - MainWindow - close() - - - -1 - -1 - - - 504 - 338 - - - - - actionAdd_tab - triggered() - MainWindow - addTab() - - - -1 - -1 - - - 504 - 338 - - - - - actionDelete_tab - triggered() - MainWindow - deleteTab() - - - -1 - -1 - - - 504 - 338 - - - - - addTabButton - clicked() - MainWindow - addTab() - - - 350 - 430 - - - 504 - 338 - - - - - detTabButton - clicked() - MainWindow - deleteTab() - - - 750 - 430 - - - 504 - 338 - - - - - actionAuto_apply - toggled(bool) - MainWindow - autoApplyCheck(bool) - - - -1 - -1 - - - 504 - 338 - - - - - actionShow_pipeline - toggled(bool) - MainWindow - showPipeline(bool) - - - -1 - -1 - - - 504 - 338 - - - - - actionShow_prop_widget - toggled(bool) - MainWindow - showProp(bool) - - - -1 - -1 - - - 504 - 338 - - - - - tabWidget - currentChanged(int) - MainWindow - currentTabChanged(int) - - - 894 - 101 - - - 504 - 338 - - - - - - changedCurrentFile(QString) - onFileOpen() - slice() - shrink() - managePlugins() - addTab() - deleteTab() - autoApplyCheck(bool) - showPipeline(bool) - showProp(bool) - currentTabChanged(int) - - diff --git a/test/standalone/src/ui/view_tab.ui b/test/standalone/src/ui/view_tab.ui deleted file mode 100644 index 67cae6a8..00000000 --- a/test/standalone/src/ui/view_tab.ui +++ /dev/null @@ -1,144 +0,0 @@ - - - ViewTab - - - - 0 - 0 - 550 - 620 - - - - Form - - - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - - - Qt::Vertical - - - - 20 - 243 - - - - - - - - - 75 - true - - - - Qt::LeftToRight - - - Choose what to display: - - - Qt::AlignCenter - - - - - - - Tabbed multi-view widget - - - - - - - Single render view - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - - - - - - - - - - - singleViewButton - clicked() - ViewTab - insertSingleView() - - - 170 - 262 - - - 170 - 239 - - - - - showTabbedButton - clicked() - ViewTab - insertMultiView() - - - 170 - 234 - - - 170 - 239 - - - - - - insertMultiView() - insertSingleView() - - diff --git a/test/standalone/src/xml/ParaViewReaders.xml b/test/standalone/src/xml/ParaViewReaders.xml deleted file mode 100644 index 9c3ce004..00000000 --- a/test/standalone/src/xml/ParaViewReaders.xml +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -