<parameter name="version" value="@SALOMEPARAVIS_VERSION@"/>
<parameter name="singleton" value="true"/>
<parameter name="show_color_legend" value="0"/>
+ <parameter name="no_ext_pv_server" value="false"/>
+ <parameter name="stop_trace" value="false"/>
+ <parameter name="tracestate_type" value="2"/>
</section>
<section name="resources">
<!-- Module resources -->
TimeAnimationCue1 = GetTimeTrack()
TimeAnimationCue1.Enabled = 0
- KeyFrameAnimationCue1 = GetAnimationTrack( ScaleVector1.GetProperty('ScaleFactor'))
+ KeyFrameAnimationCue1 = KeyFrameAnimationCue()
+ KeyFrameAnimationCue1.AnimatedProxy = ScaleVector1
+ KeyFrameAnimationCue1.AnimatedPropertyName = "ScaleFactor"
KeyFrame0 = CompositeKeyFrame( KeyValues=[1.0], Interpolation='Sinusoid' )
KeyFrame1 = CompositeKeyFrame( KeyTime=1.000000001, KeyValues=[1.0] )
AnimationScene1.Cues.append(KeyFrameAnimationCue1)
AnimationScene1.Loop = 1
AnimationScene1.PlayMode = 'Sequence'
+ AnimationScene1.StartTime = 0
+ AnimationScene1.EndTime = 1
AnimationScene1.NumberOfFrames = 21
WarpByVectorDataRepresentation = Show(WarpByVector1)
#include "PVGUI_Module.h"
#include "PVViewer_ViewManager.h"
+#include "PVViewer_Core.h"
#include "PVViewer_ViewWindow.h"
#include "PVViewer_ViewModel.h"
#include "PVGUI_ParaViewSettingsPane.h"
*/
pqPVApplicationCore* PVGUI_Module::GetPVApplication()
{
- return PVViewer_ViewManager::GetPVApplication();
+ return PVViewer_Core::GetPVApplication();
}
/*!
// Initialize ParaView client and associated behaviors
// and connect to externally launched pvserver
- PVViewer_ViewManager::ParaviewInitApp(aDesktop, anApp->logWindow());
+ PVViewer_Core::ParaviewInitApp(aDesktop, anApp->logWindow());
myGuiElements = PVViewer_GUIElements::GetInstance(aDesktop);
// [ABN]: careful with the order of the GUI element creation, the loading of the configuration
pvCreateMenus();
pvCreateToolBars();
- PVViewer_ViewManager::ParaviewInitBehaviors(true, aDesktop);
+ PVViewer_Core::ParaviewInitBehaviors(true, aDesktop);
QList<QDockWidget*> activeDocks = aDesktop->findChildren<QDockWidget*>();
QList<QMenu*> activeMenus = aDesktop->findChildren<QMenu*>();
// Connect after toolbar creation, etc ... as some activations of the toolbars is triggered
// by the ServerConnection event:
- PVViewer_ViewManager::ParaviewLoadConfigurations(true);
+ const QString configPath(PVViewer_ViewManager::GetPVConfigPath());
+ PVViewer_Core::ParaviewLoadConfigurations(configPath, true);
PVViewer_ViewManager::ConnectToExternalPVServer(aDesktop);
updateObjBrowser();
*/
void PVGUI_Module::onApplicationClosed( SUIT_Application* theApp )
{
- PVViewer_ViewManager::ParaviewCleanup();
+ PVViewer_Core::ParaviewCleanup();
CAM_Module::onApplicationClosed(theApp);
}
*/
void PVGUI_Module::createPreferences()
{
+ QList<QVariant> aIndices;
+ QStringList aStrings;
+
// Paraview settings tab
int aParaViewSettingsTab = addPreference( tr( "TIT_PVIEWSETTINGS" ) );
// Paravis settings tab
int aParaVisSettingsTab = addPreference( tr( "TIT_PVISSETTINGS" ) );
- addPreference( tr( "PREF_STOP_TRACE" ), aParaVisSettingsTab,
- LightApp_Preferences::Bool, PARAVIS_MODULE_NAME, "stop_trace" );
addPreference( tr( "PREF_NO_EXT_PVSERVER" ), aParaVisSettingsTab,
LightApp_Preferences::Bool, PARAVIS_MODULE_NAME, "no_ext_pv_server" );
+ /* VSR: not used
int aSaveType = addPreference( tr( "PREF_SAVE_TYPE_LBL" ), aParaVisSettingsTab,
LightApp_Preferences::Selector,
PARAVIS_MODULE_NAME, "savestate_type" );
- int aTraceType = addPreference( tr( "PREF_TRACE_TYPE_LBL" ), aParaVisSettingsTab,
- LightApp_Preferences::Selector,
- PARAVIS_MODULE_NAME, "tracestate_type" );
- QList<QVariant> aIndices;
- QStringList aStrings;
+ aStrings.clear();
+ aIndices.clear();
aIndices << 0 << 1 << 2;
- aStrings << tr("PREF_SAVE_TYPE_0");
- aStrings << tr("PREF_SAVE_TYPE_1");
- aStrings << tr("PREF_SAVE_TYPE_2");
+ aStrings << tr("PREF_SAVE_TYPE_0") << tr("PREF_SAVE_TYPE_1") << tr("PREF_SAVE_TYPE_2");
setPreferenceProperty( aSaveType, "strings", aStrings );
setPreferenceProperty( aSaveType, "indexes", aIndices );
+ */
+
+ // ... "Language" group <<start>>
+ int traceGroup = addPreference( tr( "PREF_GROUP_TRACE" ), aParaVisSettingsTab );
+
+ int stopTrace = addPreference( tr( "PREF_STOP_TRACE" ), traceGroup,
+ LightApp_Preferences::Bool, PARAVIS_MODULE_NAME, "stop_trace" );
+ setPreferenceProperty( stopTrace, "restart", true );
+ int aTraceType = addPreference( tr( "PREF_TRACE_TYPE_LBL" ), traceGroup,
+ LightApp_Preferences::Selector,
+ PARAVIS_MODULE_NAME, "tracestate_type" );
aStrings.clear();
- aStrings << tr("PREF_TRACE_TYPE_0");
- aStrings << tr("PREF_TRACE_TYPE_1");
- aStrings << tr("PREF_TRACE_TYPE_2");
+ aIndices.clear();
+ aIndices << 0 << 1 << 2;
+ aStrings << tr("PREF_TRACE_TYPE_0") << tr("PREF_TRACE_TYPE_1") << tr("PREF_TRACE_TYPE_2");
setPreferenceProperty( aTraceType, "strings", aStrings );
setPreferenceProperty( aTraceType, "indexes", aIndices );
+ setPreferenceProperty( aTraceType, "restart", true );
}
/*!
<source>TOOL_VCR_CONTROLS</source>
<translation>VCR Controls</translation>
</message>
+ <message>
+ <source>PREF_GROUP_TRACE</source>
+ <translation>Trace</translation>
+ </message>
<message>
<source>PREF_STOP_TRACE</source>
- <translation>Deactivate Trace (for next session only)</translation>
+ <translation>Deactivate Trace</translation>
</message>
<message>
<source>PREF_NO_EXT_PVSERVER</source>
<source>TOOL_VCR_CONTROLS</source>
<translation>Contrôles VCR</translation>
</message>
+ <message>
+ <source>PREF_GROUP_TRACE</source>
+ <translation>Trace</translation>
+ </message>
<message>
<source>PREF_STOP_TRACE</source>
<translation>Déactiver la trace (seulement pour la session suivante)</translation>
<source>TOOL_VCR_CONTROLS</source>
<translation>VCR のコントロール</translation>
</message>
+ <message>
+ <source>PREF_GROUP_TRACE</source>
+ <translation type="unfinished">Trace</translation>
+ </message>
<message>
<source>PREF_STOP_TRACE</source>
<translation>(のみのための次のセッション) のトレースを有効に</translation>
--- /dev/null
+<ServerManagerConfiguration>
+ <ProxyGroup name="filters">
+ <SourceProxy name="ArrayRenamer"
+ class="vtkArrayRenamerFilter"
+ label="Array Renamer">
+ <Documentation
+ long_help="The filter renames data arrays and array's components of the data set."
+ short_help="Renames data arrays and array's components.">
+ </Documentation>
+
+ <InputProperty name="Input"
+ command="SetInputConnection">
+ <ProxyGroupDomain name="groups">
+ <Group name="filters" />
+ <Group name="sources" />
+ </ProxyGroupDomain>
+ <DataTypeDomain name="input_type">
+ <DataType value="vtkDataObject" />
+ </DataTypeDomain>
+ <InputArrayDomain name="input_array"
+ attribute_type="any"
+ optional="1">
+ </InputArrayDomain>
+ <Documentation>
+ This property specifies the input to Array Renamer filter.
+ </Documentation>
+ </InputProperty>
+
+ <StringVectorProperty command="SetArrayInfo"
+ element_types="2 2 0"
+ name="ArrayInfo"
+ number_of_elements_per_command="3"
+ repeat_command="1"
+ clean_command="ClearArrayInfo">
+ <Documentation>Set the arrays information (new name and way how to process array: copy origin array with new name or keep existing array and set new name).</Documentation>
+ </StringVectorProperty>
+
+ <StringVectorProperty command="SetComponentInfo"
+ element_types="2 0 2"
+ name="ComponentInfo"
+ number_of_elements_per_command="3"
+ clean_command="ClearComponentsInfo"
+ repeat_command="1">
+ <Documentation>Set the compoenents information for the array.</Documentation>
+ </StringVectorProperty>
+
+ <PropertyGroup label="List of arrays"
+ panel_widget="custom_arrays_editor">
+ <Property name="ArrayInfo" function="ArrayInfo" />
+ <Property name="ComponentInfo" function="ComponentInfo"/>
+ </PropertyGroup>
+
+ <Hints>
+ <ShowInMenu category="Filters" icon=":/ArrayRenamerIcons/resources/rename_ico_24x24.png" />
+ </Hints>
+
+ </SourceProxy>
+ </ProxyGroup>
+</ServerManagerConfiguration>
--- /dev/null
+# Copyright (C) 2014-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 : Roman NIKOLAEV
+
+PROJECT(ArrayRenamer)
+
+cmake_minimum_required(VERSION 2.8)
+
+FIND_PACKAGE(ParaView REQUIRED)
+INCLUDE(${PARAVIEW_USE_FILE})
+
+SET (outifaces)
+SET (outsrcs)
+
+QT4_WRAP_CPP(moc_srcs pqArraysEditorPropertyWidget.h pqEditComponents.h)
+
+ ADD_PARAVIEW_PROPERTY_GROUP_WIDGET(outifaces outsrcs
+ TYPE "custom_arrays_editor"
+ CLASS_NAME pqArraysEditorPropertyWidget)
+
+ADD_PARAVIEW_PLUGIN(ArrayRenamer "1.0"
+ SERVER_MANAGER_XML ArrayRenamer.xml
+ SERVER_MANAGER_SOURCES vtkArrayRenamerFilter.cxx
+ GUI_INTERFACES ${outifaces}
+ GUI_RESOURCES pqArrayRenamer.qrc
+ SOURCES ${outsrcs} ${moc_srcs} pqArraysEditorPropertyWidget.cxx
+ )
+
+INSTALL(TARGETS ArrayRenamer
+ DESTINATION lib/paraview
+)
--- /dev/null
+pv_plugin(ArrayRenamer
+ DESCRIPTION "Renames data arrays and array's components"
+ DEFAULT_ENABLED)
--- /dev/null
+<RCC>
+ <qresource prefix="/ArrayRenamerIcons" >
+ <file>resources/rename_ico_24x24.png</file>
+ <file>resources/copy_ico_16x16.png</file>
+ <file>resources/edit_ico_16x16.png</file>
+ </qresource>
+</RCC>
--- /dev/null
+// Copyright (C) 2014-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 : Roman NIKOLAEV
+
+// Local includes
+#include "pqArraysEditorPropertyWidget.h"
+#include "pqEditComponents.h"
+
+//ParaView includes
+#include <vtkPVArrayInformation.h>
+#include <vtkPVDataInformation.h>
+#include <vtkPVDataSetAttributesInformation.h>
+#include <vtkSMPropertyGroup.h>
+#include <vtkSMSourceProxy.h>
+#include <vtkSMUncheckedPropertyHelper.h>
+
+// Qt Includes
+#include <QAbstractTableModel>
+#include <QApplication>
+#include <QCheckBox>
+#include <QDialog>
+#include <QGroupBox>
+#include <QHBoxLayout>
+#include <QHeaderView>
+#include <QPushButton>
+#include <QPushButton>
+#include <QSpacerItem>
+#include <QTableView>
+#include <QVBoxLayout>
+
+// STD includes
+#include <limits>
+
+
+/// Table model for the components table
+class pqComponentsModel : public QAbstractTableModel {
+ typedef QAbstractTableModel Superclass;
+public:
+ typedef QPair<QString, QString> SingleComponentInfoType;
+ typedef QVector<SingleComponentInfoType> ComponentsInfoType;
+private:
+ ComponentsInfoType myComponentsInfoVector;
+ bool myRenameSimilar;
+
+public:
+ enum ColumnRoles {
+ COMPONENT_NAME = 0,
+ NEW_COMPONENT_NAME = 1,
+ };
+
+ //------------------------------------------------------------------
+ pqComponentsModel( QObject* parentObject=0 ):
+ Superclass(parentObject),
+ myRenameSimilar(false) {}
+
+ //------------------------------------------------------------------
+ virtual ~pqComponentsModel() {}
+
+ void setRenameSimilar( bool IsRenameSimilar ) {
+ myRenameSimilar = IsRenameSimilar;
+ if ( myRenameSimilar ) {
+ QHash<QString,QString> anUnique;
+ foreach( SingleComponentInfoType item, myComponentsInfoVector ) {
+ if( !anUnique.contains( item.first ) ) {
+ anUnique.insert( item.first,item.second );
+ }
+ }
+ bool modified = false;
+ int min = std::numeric_limits<int>::max();
+ int max = std::numeric_limits<int>::min();
+ for( int i = 0; i < myComponentsInfoVector.size(); i++ ) {
+ if( anUnique.contains( myComponentsInfoVector[i].first) &&
+ anUnique.value( myComponentsInfoVector[i].first ) != myComponentsInfoVector[i].second ) {
+ myComponentsInfoVector[i].second = anUnique.value( myComponentsInfoVector[i].first );
+ min = qMin( min, i );
+ max = qMax( max, i );
+ modified = true;
+ }
+ }
+ if( modified ) {
+ emit dataChanged( index( 1, min ) , index( 1, max ) );
+ }
+ }
+ }
+
+ //------------------------------------------------------------------
+ virtual Qt::ItemFlags flags( const QModelIndex &idx ) const {
+ Qt::ItemFlags value = Superclass::flags( idx );
+ if ( idx.isValid() ) {
+ switch ( idx.column() ) {
+ case NEW_COMPONENT_NAME: return value | Qt::ItemIsEditable;
+ default:
+ break;
+ }
+ }
+ return value;
+ }
+
+ //------------------------------------------------------------------
+ virtual int rowCount( const QModelIndex& idx=QModelIndex() ) const {
+ return idx.isValid() ? 0 : myComponentsInfoVector.size();
+ }
+
+ //------------------------------------------------------------------
+ virtual int columnCount( const QModelIndex& idx=QModelIndex() ) const {
+ Q_UNUSED( idx );
+ return 2;
+ }
+
+ //------------------------------------------------------------------
+ virtual QVariant data(const QModelIndex& idx, int role=Qt::DisplayRole) const {
+ if ( idx.column() == COMPONENT_NAME ) {
+ switch ( role ) {
+ case Qt::DisplayRole:
+ case Qt::ToolTipRole:
+ case Qt::StatusTipRole:
+ return myComponentsInfoVector[idx.row()].first;
+ default:
+ break;
+ }
+ }
+ else if (idx.column() == NEW_COMPONENT_NAME) {
+ switch (role) {
+ case Qt::DisplayRole:
+ case Qt::EditRole:
+ case Qt::ToolTipRole:
+ case Qt::StatusTipRole:
+ return myComponentsInfoVector[idx.row()].second;
+ case Qt::ForegroundRole: {
+ if ( myComponentsInfoVector[idx.row()].second == myComponentsInfoVector[idx.row()].first )
+ return QApplication::palette().color(QPalette::Disabled, QPalette::Text);
+ }
+ case Qt::FontRole: {
+ if ( myComponentsInfoVector[idx.row()].second == myComponentsInfoVector[idx.row()].first ) {
+ QFont f = QApplication::font();
+ f.setItalic(true);
+ return f;
+ }
+ }
+ default:
+ break;
+ }
+ }
+ return QVariant();
+ }
+
+ //------------------------------------------------------------------
+ virtual bool setData(const QModelIndex &idx, const QVariant &value, int role=Qt::EditRole) {
+ if (idx.column() == NEW_COMPONENT_NAME && role == Qt::EditRole ) {
+ QString new_name = value.toString();
+ Q_ASSERT(idx.row() < myComponentsInfoVector.size());
+ myComponentsInfoVector[idx.row()].second = new_name;
+ int min = idx.row();
+ int max = idx.row();
+ if( myRenameSimilar ) {
+ QString ref_name = myComponentsInfoVector[idx.row()].first;
+ for( int i = 0; i < myComponentsInfoVector.size(); i++ ) {
+ if(myComponentsInfoVector[i].first == ref_name) {
+ min = qMin( min, i );
+ max = qMax( max, i );
+ myComponentsInfoVector[i].second = new_name;
+ }
+ }
+ }
+ emit dataChanged( index( 1, min ) , index( 1, max ) );
+ return true;
+ }
+ }
+
+ //------------------------------------------------------------------
+ QVariant headerData( int section, Qt::Orientation orientation, int role ) const {
+ if ( orientation == Qt::Horizontal ) {
+ if ( role == Qt::DisplayRole || role == Qt::ToolTipRole ) {
+ switch (section) {
+ case COMPONENT_NAME:
+ return role == Qt::DisplayRole? "Origin Name": "Origin Names of components";
+ case NEW_COMPONENT_NAME:
+ return role == Qt::DisplayRole? "New Name": "New Names of components";
+ default:
+ break;
+ }
+ }
+ }
+ return this->Superclass::headerData(section, orientation, role);
+ }
+
+ //------------------------------------------------------------------
+ void setComponentsInfo( const ComponentsInfoType& data ) {
+ emit this->beginResetModel();
+ myComponentsInfoVector = data;
+ emit this->endResetModel();
+ }
+
+ //------------------------------------------------------------------
+ const ComponentsInfoType& componentsInfo() const {
+ return myComponentsInfoVector;
+ }
+private:
+ Q_DISABLE_COPY(pqComponentsModel);
+};
+
+/// Table model for the array's table
+class pqArraysModel : public QAbstractTableModel
+{
+ typedef QAbstractTableModel Superclass;
+public:
+ struct ArrayInfo {
+ bool copyArray; // How to porocess arrays: remane origin array or keep origin and make copy with the new name
+ QString newName;
+ pqComponentsModel::ComponentsInfoType myComponentsInfo;
+
+ public:
+
+ //------------------------------------------------------------------
+ const int nbComps() const {
+ return myComponentsInfo.size();
+ }
+
+ //------------------------------------------------------------------
+ const bool isCompomentsModified() const {
+ foreach(pqComponentsModel::SingleComponentInfoType item , myComponentsInfo) {
+ if(item.first != item.second)
+ return true;
+ }
+ return false;
+ }
+ };
+
+public:
+ typedef QPair<QString, ArrayInfo> ArraysInfoItemType;
+ typedef QVector<ArraysInfoItemType> ArraysInfoType;
+
+private:
+ ArraysInfoType myArraysInfo;
+
+public:
+
+ //------------------------------------------------------------------
+ enum ColumnRoles {
+ PROCESSING = 0,
+ NAME = 1,
+ NEW_NAME = 2,
+ COMPONENTS = 3,
+ };
+
+ //------------------------------------------------------------------
+ pqArraysModel( QObject* parentObject=0 ) :
+ Superclass( parentObject ) { }
+
+ //------------------------------------------------------------------
+ virtual ~pqArraysModel() { }
+
+ //------------------------------------------------------------------
+ virtual Qt::ItemFlags flags( const QModelIndex &idx ) const {
+ Qt::ItemFlags value = Superclass::flags( idx );
+ if (idx.isValid()) {
+ switch ( idx.column() ) {
+ case PROCESSING:
+ return value | Qt::ItemIsUserCheckable;
+ case NEW_NAME:
+ return value | Qt::ItemIsEditable;
+ default:
+ break;
+ }
+ }
+ return value;
+ }
+
+ //------------------------------------------------------------------
+ virtual int rowCount( const QModelIndex& idx=QModelIndex() ) const {
+ return idx.isValid() ? 0 : myArraysInfo.size();
+ }
+
+ //------------------------------------------------------------------
+ virtual int columnCount( const QModelIndex& idx=QModelIndex() ) const {
+ Q_UNUSED(idx);
+ return 4;
+ }
+
+ //------------------------------------------------------------------
+ virtual QVariant data(const QModelIndex& idx, int role=Qt::DisplayRole) const {
+ Q_ASSERT( idx.row() < myArraysInfo.size() );
+ if ( idx.column() == PROCESSING ) {
+ switch (role) {
+ case Qt::CheckStateRole:
+ return myArraysInfo[idx.row()].second.copyArray ? Qt::Checked : Qt::Unchecked;
+ default:
+ break;
+ }
+ } else if ( idx.column() == NAME ) {
+ switch ( role ) {
+ case Qt::DisplayRole:
+ case Qt::ToolTipRole:
+ case Qt::StatusTipRole:
+ return myArraysInfo[idx.row()].first;
+ default:
+ break;
+ }
+ } else if ( idx.column() == NEW_NAME ) {
+ switch (role) {
+ case Qt::DisplayRole:
+ case Qt::EditRole:
+ case Qt::ToolTipRole:
+ case Qt::StatusTipRole:
+ return myArraysInfo[idx.row()].second.newName;
+ case Qt::ForegroundRole: {
+ if ( myArraysInfo[idx.row()].second.newName == myArraysInfo[idx.row()].first )
+ return QApplication::palette().color(QPalette::Disabled, QPalette::Text);
+ }
+ case Qt::FontRole: {
+ if ( myArraysInfo[idx.row()].second.newName == myArraysInfo[idx.row()].first ) {
+ QFont f = QApplication::font();
+ f.setItalic(true);
+ return f;
+ }
+ }
+ default:
+ break;
+ }
+ }
+ return QVariant();
+ }
+
+ //------------------------------------------------------------------
+ virtual bool setData(const QModelIndex &idx, const QVariant &value, int role=Qt::EditRole) {
+
+ if (idx.column() == PROCESSING && role == Qt::CheckStateRole) {
+ bool checkState = (value.toInt() == Qt::Checked);
+ Q_ASSERT(idx.row() < myArraysInfo.size());
+ myArraysInfo[idx.row()].second.copyArray = (bool)checkState;
+ emit dataChanged(idx, idx);
+ return true;
+ }
+
+ if (idx.column() == NEW_NAME && role == Qt::EditRole) {
+ QString new_name = value.toString();
+ if ( !new_name.isEmpty() ) {
+ Q_ASSERT(idx.row() < myArraysInfo.size());
+ myArraysInfo[idx.row()].second.newName = new_name;
+ emit dataChanged(idx, idx);
+ return true;
+ }
+ }
+ }
+
+ //------------------------------------------------------------------
+ QVariant headerData(int section, Qt::Orientation orientation, int role) const {
+ if ( orientation == Qt::Horizontal ) {
+ if ( role == Qt::DisplayRole || role == Qt::ToolTipRole ) {
+ switch ( section ) {
+ case PROCESSING:
+ return role == Qt::DisplayRole? "": "Toggle to copy arrays";
+ case NAME:
+ return role == Qt::DisplayRole? "Origin Name": "Origin Names of arrays";
+ case NEW_NAME:
+ return role == Qt::DisplayRole? "New Name": "New Names of arrays";
+ case COMPONENTS:
+ return role == Qt::DisplayRole? "Components" : "Click item to edit components";
+ default:
+ break;
+ }
+ } else if ( role == Qt::DecorationRole ) {
+ switch ( section ) {
+ case PROCESSING: return QIcon( ":/ArrayRenamerIcons/resources/copy_ico_16x16.png" );
+ default:
+ break;
+ }
+ }
+ }
+ return Superclass::headerData( section, orientation, role );
+ }
+
+ //------------------------------------------------------------------
+ QString arrayName( const QModelIndex& idx ) const {
+ if ( idx.isValid() && idx.row() < myArraysInfo.size() ) {
+ return myArraysInfo[idx.row()].first;
+ }
+ return QString();
+ }
+
+ //------------------------------------------------------------------
+ void setArraysInfo( const QVector<QPair<QString, ArrayInfo> >& data ) {
+ emit beginResetModel();
+ myArraysInfo = data;
+ emit endResetModel();
+ }
+
+ //------------------------------------------------------------------
+ const ArraysInfoType& arraysInfo() const {
+ return myArraysInfo;
+ }
+
+ //------------------------------------------------------------------
+ ArraysInfoType& editArraysInfo() {
+ return myArraysInfo;
+ }
+
+private:
+ Q_DISABLE_COPY(pqArraysModel);
+};
+
+//-----------------------------------------------------------------------------
+pqEditComponents::pqEditComponents( pqComponentsModel* model, QWidget* parent ) {
+
+ myComponentsModel = model;
+ setWindowTitle( "Edit Components" );
+
+ //Layout
+ QVBoxLayout *mainLayout = new QVBoxLayout( this );
+ QGroupBox* aComps = new QGroupBox( "Components", this );
+ QGroupBox* aParams = new QGroupBox( "Parameters", this );
+ QGroupBox* aBtns = new QGroupBox( this );
+ mainLayout->addWidget( aComps );
+ mainLayout->addWidget( aParams );
+ mainLayout->addWidget( aBtns );
+
+ /// Table
+ QVBoxLayout *aCompsLayout = new QVBoxLayout( aComps );
+ QTableView* componentsTable = new QTableView( this );
+ componentsTable->setModel( model );
+ aCompsLayout->addWidget( componentsTable );
+ componentsTable->horizontalHeader()->setResizeMode( pqComponentsModel::COMPONENT_NAME, QHeaderView::Stretch );
+ componentsTable->horizontalHeader()->setResizeMode( pqComponentsModel::NEW_COMPONENT_NAME, QHeaderView::Stretch );
+
+ /// Parameters
+ QVBoxLayout *aParamsLayout = new QVBoxLayout( aParams );
+ myRenameAllComps = new QCheckBox( "Rename all similar Components", aParams );
+ aParamsLayout->addWidget( myRenameAllComps );
+
+ /// Buttons
+ QPushButton* anOk = new QPushButton( "OK", this );
+ QPushButton* aCancel = new QPushButton( "Cancel", this );
+ QSpacerItem* space = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum );
+ QHBoxLayout* aBtnsLayout = new QHBoxLayout( aBtns );
+ aBtnsLayout->addWidget( anOk );
+ aBtnsLayout->addItem( space );
+ aBtnsLayout->addWidget( aCancel );
+
+ //Connections
+ connect( anOk, SIGNAL( clicked() ), this, SLOT( accept() ) );
+ connect( myRenameAllComps, SIGNAL( toggled(bool) ), this, SLOT( onRenameAll(bool) ) );
+ connect( aCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
+}
+
+//-----------------------------------------------------------------------------
+pqEditComponents::~pqEditComponents() { }
+
+//-----------------------------------------------------------------------------
+bool pqEditComponents::renameAllComps() {
+ return myRenameAllComps->checkState() == Qt::Checked;
+}
+
+//-----------------------------------------------------------------------------
+void pqEditComponents::onRenameAll( bool val ) {
+ myComponentsModel->setRenameSimilar( val );
+}
+
+//-----------------------------------------------------------------------------
+pqArraysEditorPropertyWidget::pqArraysEditorPropertyWidget( vtkSMProxy* smproxy, vtkSMPropertyGroup* smgroup, QWidget* parentObject ) :
+ Superclass(smproxy, parentObject) {
+
+ myPropertyGroup = smgroup;
+ myConnection = vtkEventQtSlotConnect::New();
+
+ // Table
+ myArraysTable = new QTableView(this);
+ myArraysModel = new pqArraysModel(this);
+ myArraysTable->setModel(myArraysModel);
+
+ // Layout
+ QVBoxLayout* lay = new QVBoxLayout(this);
+ lay->addWidget(myArraysTable);
+ myArraysTable->horizontalHeader()->setResizeMode( pqArraysModel::PROCESSING, QHeaderView::ResizeToContents );
+ myArraysTable->horizontalHeader()->setResizeMode( pqArraysModel::NAME, QHeaderView::Stretch);
+ myArraysTable->horizontalHeader()->setResizeMode( pqArraysModel::NEW_NAME, QHeaderView::Stretch );
+ myArraysTable->horizontalHeader()->setResizeMode( pqArraysModel::COMPONENTS, QHeaderView::ResizeToContents );
+ myArraysTable->resizeColumnsToContents();
+
+ // Connections
+ /// Clien < - > Server
+ addPropertyLink( this, "arrayInfo", SIGNAL( arraysInfoChanged() ), smgroup->GetProperty( "ArrayInfo" ) );
+ addPropertyLink( this, "componentsInfo", SIGNAL( componentsInfoChanged() ), smgroup->GetProperty( "ComponentInfo" ) );
+ myConnection->Connect( smproxy, vtkCommand::UpdateDataEvent, this, SLOT( onInputDataChanged() ) );
+
+ /// Qt
+ QObject::connect( myArraysModel,
+ SIGNAL( dataChanged( const QModelIndex &, const QModelIndex& ) ),
+ this, SLOT( onDataChanged( const QModelIndex&, const QModelIndex& ) ) );
+
+ // Obtains list of the data arrays
+ updateArraysList();
+}
+
+pqArraysEditorPropertyWidget::~pqArraysEditorPropertyWidget() {
+ delete myArraysModel;
+ myConnection->Delete();
+}
+
+//-----------------------------------------------------------------------------
+void pqArraysEditorPropertyWidget::setArraysInfo( const QList<QVariant> & values ){
+ pqArraysModel::ArraysInfoType vdata;
+ vdata.resize( values.size()/3 );
+ for ( int cc=0; ( cc + 1 ) < values.size(); cc+=3 ) {
+ vdata[cc/3].first = values[cc].toString();
+ vdata[cc/3].second.newName = values[cc+1].toString();
+ vdata[cc/3].second.copyArray = values[cc+2].toBool();
+ }
+ myArraysModel->setArraysInfo( vdata );
+}
+
+//-----------------------------------------------------------------------------
+QList<QVariant> pqArraysEditorPropertyWidget::arraysInfo() const {
+ const pqArraysModel::ArraysInfoType &vdata = myArraysModel->arraysInfo();
+ QList<QVariant> reply;
+ for ( int cc=0; cc < vdata.size(); cc++ ) {
+ if(vdata[cc].first != vdata[cc].second.newName ) {
+ reply.push_back( vdata[cc].first );
+ reply.push_back( vdata[cc].second.newName );
+ reply.push_back( vdata[cc].second.copyArray ? 1 : 0 );
+ }
+ }
+ return reply;
+}
+
+//-----------------------------------------------------------------------------
+void pqArraysEditorPropertyWidget::setComponentsInfo( const QList<QVariant> & values ) {
+
+ pqArraysModel::ArraysInfoType &vdata = myArraysModel->editArraysInfo();
+ for(int i = 0; i < vdata.size(); i++) {
+ vdata.resize( values.size()/3 );
+ QString anArrayName = "", aNewCompName = "";
+ int aCompId = 0;
+ for ( int cc=0; ( cc + 1 ) < values.size(); cc+=3 ) {
+ anArrayName = values[cc].toString();
+ aCompId = values[cc+1].toInt();
+ aNewCompName = values[cc+2].toString();
+ }
+ if( vdata[i].first == anArrayName && aCompId < vdata[i].second.myComponentsInfo.size() ) {
+ vdata[i].second.myComponentsInfo[i].second = aNewCompName;
+ }
+ }
+}
+
+//-----------------------------------------------------------------------------
+QList<QVariant> pqArraysEditorPropertyWidget::componentsInfo() const {
+
+ pqArraysModel::ArraysInfoType &vdata = myArraysModel->editArraysInfo();
+ QList<QVariant> reply;
+ for ( int cc=0; cc < vdata.size(); cc++ ) {
+ for ( int ll = 0; ll < vdata[cc].second.myComponentsInfo.size(); ll++ ) {
+ if ( vdata[cc].second.myComponentsInfo[ll].second != vdata[cc].second.myComponentsInfo[ll].first) {
+ QString aArrayName =
+ (vdata[cc].first != vdata[cc].second.newName && !vdata[cc].second.newName.isEmpty()) ? vdata[cc].second.newName : vdata[cc].first;
+ reply.push_back( aArrayName );
+ reply.push_back( ll );
+ reply.push_back( vdata[cc].second.myComponentsInfo[ll].second );
+ }
+ }
+ }
+
+ return reply;
+}
+
+//-----------------------------------------------------------------------------
+void pqArraysEditorPropertyWidget::onDataChanged( const QModelIndex& topleft, const QModelIndex& btmright ) {
+ if ( topleft.column() == pqArraysModel::PROCESSING || topleft.column() == pqArraysModel::NEW_NAME ) {
+ if ( topleft.column() == pqArraysModel::PROCESSING ) {
+ const pqArraysModel::ArraysInfoType &vdata = myArraysModel->arraysInfo();
+ Q_ASSERT(topleft.row() < vdata.size());
+ if( vdata[topleft.row()].second.isCompomentsModified() ) {
+ myPropertyGroup->GetProperty( "ComponentInfo" )->Modified();
+ }
+ }
+ emit arraysInfoChanged();
+ }
+}
+
+//-----------------------------------------------------------------------------
+void pqArraysEditorPropertyWidget::updateArraysList() {
+ vtkPVDataSetAttributesInformation *cdi = NULL, *pdi = NULL;
+
+ vtkSMSourceProxy* input = vtkSMSourceProxy::SafeDownCast( vtkSMUncheckedPropertyHelper( proxy(), "Input" ).GetAsProxy( 0 ) );
+
+ // Null insput
+ if ( !input )
+ return;
+
+ const QVector<QPair<QString, pqArraysModel::ArrayInfo> > &oldModelData = myArraysModel->arraysInfo();
+
+ QStringList oldNames;
+ QPair<QString, pqArraysModel::ArrayInfo> oldArrayInfo;
+ foreach ( oldArrayInfo, oldModelData ) {
+ oldNames.append(oldArrayInfo.first);
+ }
+
+ myDataTime = input->GetDataInformation( 0 )->GetMTime();
+
+ pdi = input->GetDataInformation( 0 )->GetPointDataInformation();
+ cdi = input->GetDataInformation( 0 )->GetCellDataInformation();
+ QVector<QPair<QString, pqArraysModel::ArrayInfo> > myModelArraysInfo;
+
+ if ( pdi ) {
+ for ( int i=0; i<pdi->GetNumberOfArrays(); i++ ) {
+ vtkPVArrayInformation* pvArrayInformation = pdi->GetArrayInformation( i );
+ QString anArrayName = QString( pvArrayInformation->GetName() );
+ int numComponents = pvArrayInformation->GetNumberOfComponents();
+ int index = oldNames.indexOf(anArrayName);
+ if ( index < 0 ) {
+
+ myModelArraysInfo.push_back( qMakePair( anArrayName , pqArraysModel::ArrayInfo() ) );
+ myModelArraysInfo.last().second.newName = anArrayName;
+ for ( int j=0; j<numComponents; j++ ) {
+ QString compName = pvArrayInformation->GetComponentName( j );
+ myModelArraysInfo.last().second.myComponentsInfo.insert(j, qMakePair( compName, compName ) );
+ }
+ } else {
+
+ myModelArraysInfo.push_back( qMakePair(anArrayName, oldModelData[index].second ) );
+ if ( oldModelData[index].second.nbComps() != numComponents ) {
+ for ( int j=0; j<numComponents; j++ ) {
+ QString compName = pvArrayInformation->GetComponentName( j );
+ myModelArraysInfo.last().second.myComponentsInfo.insert( j, qMakePair( compName, compName ) );
+ }
+ }
+ }
+ }
+ }
+ if ( cdi ) {
+ for ( int i=0; i<cdi->GetNumberOfArrays(); i++ ) {
+
+ vtkPVArrayInformation* pvArrayInformation = cdi->GetArrayInformation( i );
+ QString anArrayName = QString( pvArrayInformation->GetName() );
+ int numComponents = pvArrayInformation->GetNumberOfComponents();
+ int index = oldNames.indexOf(anArrayName);
+ if ( index < 0 ) {
+ myModelArraysInfo.push_back( qMakePair( anArrayName , pqArraysModel::ArrayInfo() ) );
+ myModelArraysInfo.last().second.newName = anArrayName;
+ for ( int j=0; j<numComponents; j++ ){
+ QString compName = pvArrayInformation->GetComponentName( j );
+ myModelArraysInfo.last().second.myComponentsInfo.insert( j, qMakePair( compName, compName ) );
+ }
+ } else {
+
+ myModelArraysInfo.push_back( qMakePair(anArrayName, oldModelData[index].second ) );
+ if ( oldModelData[index].second.nbComps() != numComponents ) {
+ for ( int j=0; j<numComponents; j++ ) {
+ QString compName = pvArrayInformation->GetComponentName( j );
+ myModelArraysInfo.last().second.myComponentsInfo.insert( j, qMakePair( compName, compName ) );
+ }
+ }
+ }
+ }
+ }
+
+ myArraysModel->setArraysInfo(myModelArraysInfo);
+
+ for ( int i = 0; i < myModelArraysInfo.size(); i++ ) {
+ if ( myModelArraysInfo[i].second.nbComps() > 1 ) {
+ QPushButton* aBtn = new QPushButton(myArraysTable);
+ aBtn->setProperty("arrayName",myModelArraysInfo[i].first);
+ aBtn->setIcon( QIcon( ":/ArrayRenamerIcons/resources/edit_ico_16x16.png" ) );
+ myArraysTable->setIndexWidget( myArraysModel->index( i, 3 ), aBtn );
+ connect(aBtn, SIGNAL( clicked() ) , this, SLOT( onComponentsEdit() ) );
+ }
+ }
+}
+
+//-----------------------------------------------------------------------------
+void pqArraysEditorPropertyWidget::onInputDataChanged() {
+
+ vtkSMSourceProxy* input = vtkSMSourceProxy::SafeDownCast( vtkSMUncheckedPropertyHelper( proxy(), "Input" ).GetAsProxy( 0 ) );
+ if ( myDataTime < input->GetDataInformation( 0 )->GetMTime() ) {
+ updateArraysList();
+ }
+}
+
+//-----------------------------------------------------------------------------
+void pqArraysEditorPropertyWidget::onComponentsEdit() {
+ QObject* snd = sender();
+ QVariant v = snd->property("arrayName");
+ int index = -1;
+
+ if( v.isValid() ) {
+ QString anArrayName = v.toString();
+ pqComponentsModel::ComponentsInfoType* aComponents = NULL;
+ pqArraysModel::ArraysInfoType &aModelData = myArraysModel->editArraysInfo();
+ for ( int i = 0 ; i < aModelData.size() ; i++ ) {
+ pqArraysModel::ArraysInfoItemType& item = aModelData[i];
+ if( item.first == anArrayName ) {
+ aComponents = &item.second.myComponentsInfo;
+ index = i;
+ break;
+ }
+ }
+
+ if( aComponents ) {
+ pqComponentsModel* aCompsModel = new pqComponentsModel();
+ aCompsModel->setComponentsInfo(*aComponents);
+ pqEditComponents* dlg = new pqEditComponents(aCompsModel, this);
+ if ( dlg->exec() == QDialog::Accepted ) {
+ const pqComponentsModel::ComponentsInfoType& aRenamedComponents = aCompsModel->componentsInfo();
+ if( dlg->renameAllComps() ) {
+ /// Rename all components in all arrays
+ for ( int i = 0 ; i < aModelData.size() ; i++ ) {
+ pqArraysModel::ArraysInfoItemType& item = aModelData[i];
+ for (int j = 0; j < item.second.myComponentsInfo.size(); j++ ) {
+ pqComponentsModel::ComponentsInfoType &aComps = item.second.myComponentsInfo;
+ for (int k = 0; k < aRenamedComponents.size(); k++ ) {
+ if( aComps[j].first == aRenamedComponents[k].first ) {
+ aComps[j].second = aRenamedComponents[k].second;
+ }
+ }
+ }
+ }
+ } else {
+ if( index >= 0 ) {
+ aModelData[index].second.myComponentsInfo = aRenamedComponents;
+ }
+ }
+ emit componentsInfoChanged();
+ }
+ delete dlg;
+ delete aCompsModel;
+ }
+ }
+}
--- /dev/null
+// Copyright (C) 2014-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 : Roman NIKOLAEV
+
+/*========================================================================*/
+#ifndef __pqArraysEditorPropertyWidget_h
+#define __pqArraysEditorPropertyWidget_h
+
+#include <pqPropertyWidget.h>
+#include <vtkSmartPointer.h>
+
+// ParaView classes
+class vtkSMPropertyGroup;
+class vtkEventQtSlotConnect;
+
+// Qt Classes
+class QTableView;
+class QModelIndex;
+
+class pqArraysModel;
+
+/// pqArraysEditorPropertyWidget is the pqPropertyWidget used to edit
+/// arrays and array's components.
+class VTK_EXPORT pqArraysEditorPropertyWidget : public pqPropertyWidget {
+
+ Q_OBJECT
+
+ Q_PROPERTY(QList<QVariant> arrayInfo
+ READ arraysInfo
+ WRITE setArraysInfo
+ NOTIFY arraysInfoChanged)
+
+ Q_PROPERTY(QList<QVariant> componentsInfo
+ READ componentsInfo
+ WRITE setComponentsInfo
+ NOTIFY componentsInfoChanged)
+
+
+ typedef pqPropertyWidget Superclass;
+ public:
+ pqArraysEditorPropertyWidget(vtkSMProxy* proxy, vtkSMPropertyGroup* smgroup, QWidget* parent=0);
+ virtual ~pqArraysEditorPropertyWidget();
+
+ /// Get/Set the arrays Info
+ QList<QVariant> arraysInfo() const;
+ void setArraysInfo(const QList<QVariant>&);
+
+ /// Get/Set the arrays Info
+ QList<QVariant> componentsInfo() const;
+ void setComponentsInfo(const QList<QVariant>&);
+
+
+ signals:
+ /// Fired when the arrays Info is changes.
+ void arraysInfoChanged();
+ void componentsInfoChanged();
+
+private slots:
+ /// called whenever the internal model's data changes.
+ void onDataChanged(const QModelIndex& topleft, const QModelIndex& btmright);
+ void onComponentsEdit();
+
+ /// called whenever the input changed.
+ void onInputDataChanged();
+
+ private: // Methods
+ void updateArraysList();
+
+ private: // Fields
+
+ vtkSmartPointer<vtkSMPropertyGroup> myPropertyGroup;
+ vtkEventQtSlotConnect* myConnection;
+ unsigned long myDataTime;
+
+ //Array's table
+ pqArraysModel* myArraysModel;
+ QTableView* myArraysTable;
+};
+
+#endif // __pqArraysEditorPropertyWidget_h
--- /dev/null
+// Copyright (C) 2014-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 : Roman NIKOLAEV
+
+
+#include <QDialog>
+
+class pqComponentsModel;
+class QCheckBox;
+
+class pqEditComponents : public QDialog {
+ Q_OBJECT
+public:
+ pqEditComponents( pqComponentsModel* model, QWidget* parent );
+ ~pqEditComponents();
+
+ bool renameAllComps();
+
+private slots:
+ void onRenameAll(bool val);
+ private:
+ QCheckBox* myRenameAllComps;
+ pqComponentsModel* myComponentsModel;
+
+};
--- /dev/null
+// Copyright (C) 2014-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 : Roman NIKOLAEV
+
+#include "vtkArrayRenamerFilter.h"
+
+#include <vtkCellData.h>
+#include <vtkDataArray.h>
+#include <vtkDataObjectTreeIterator.h>
+#include <vtkDataSet.h>
+#include <vtkDoubleArray.h>
+#include <vtkInformation.h>
+#include <vtkInformationVector.h>
+#include <vtkMultiBlockDataSet.h>
+#include <vtkObjectFactory.h>
+#include <vtkPointData.h>
+#include <vtkStreamingDemandDrivenPipeline.h>
+#include <vtkStringArray.h>
+#include <vtkUnstructuredGrid.h>
+
+#include <map>
+#include <string>
+#include <vector>
+
+//For debug
+//#include <iostream>
+
+class vtkArrayRenamerFilter::vtkInternals
+{
+public:
+ //Vector which contains information about array's components : origin_component_name <-> new_name
+ typedef std::vector< std::pair<int, std::string> > ComponentsInfo;
+
+ struct ArrayInfo
+ {
+ std::string NewName; // New name of the array
+ bool CopyArray; // Make copy of the array or keep origin array, but change the name
+ ComponentsInfo ComponentVector; // Components of the array
+ ArrayInfo():
+ NewName( "" ),
+ CopyArray( false )
+ {
+ }
+ };
+ typedef std::map<std::string, ArrayInfo> ArraysType; // Map : origin_aray_name <-> ArrayInfo struct
+ ArraysType Arrays;
+};
+
+
+//------------------------------------------------------------------------------
+vtkStandardNewMacro(vtkArrayRenamerFilter);
+//--------------------------------------------------------------------------------------------------
+vtkArrayRenamerFilter::vtkArrayRenamerFilter()
+{
+ this->Internals = new vtkInternals();
+}
+
+//--------------------------------------------------------------------------------------------------
+vtkArrayRenamerFilter::~vtkArrayRenamerFilter()
+{
+ delete this->Internals;
+}
+
+
+
+//--------------------------------------------------------------------------------------------------
+int vtkArrayRenamerFilter::RequestData( vtkInformation* theRequest,
+ vtkInformationVector** theInputVector,
+ vtkInformationVector* theOutputVector )
+{
+
+ //std::cout<<"vtkArrayRenamerFilter::RequestData !!! "<<std::endl;
+
+ // Get the information
+ vtkInformation *anInputInfo = theInputVector[0]->GetInformationObject( 0 );
+ vtkInformation *anOutputInfo = theOutputVector->GetInformationObject( 0 );
+
+ vtkDataSet* anInput = vtkDataSet::GetData(theInputVector[0], 0);
+ vtkDataSet* anOutput = vtkDataSet::GetData(theOutputVector, 0);
+ anOutput->DeepCopy(anInput);
+ vtkFieldData* data = 0;
+
+ vtkInternals::ArraysType::iterator it = this->Internals->Arrays.begin();
+ for( ; it != this->Internals->Arrays.end(); it ++ ) {
+ vtkDataArray* array = anOutput->GetPointData()->GetArray( it->first.c_str() );
+ data = anOutput->GetPointData();
+ if( !array ) {
+ array = anOutput->GetCellData()->GetArray( it->first.c_str() );
+ data = anOutput->GetCellData();
+ }
+
+ if( array && !it->second.NewName.empty() ) {
+
+ if ( it->second.CopyArray ) {
+ vtkDataArray* new_array = array->NewInstance();
+ new_array->DeepCopy(array);
+ data->AddArray(new_array);
+ array = new_array;
+ }
+ array->SetName(it->second.NewName.c_str());
+ }
+
+ if ( array ) {
+ vtkInternals::ComponentsInfo::iterator vect_it = it->second.ComponentVector.begin();
+ for( ; vect_it != it->second.ComponentVector.end(); vect_it++ ) {
+ array->SetComponentName( vect_it->first, vect_it->second.c_str() );
+ }
+ }
+ }
+
+ return Superclass::RequestData( theRequest, theInputVector, theOutputVector );
+}
+
+
+void vtkArrayRenamerFilter::SetComponentInfo( const char* arrayname, const int compid, const char* newcompname ) {
+ //std::cout<<"vtkArrayRenamerFilter::SetComponentArrayInfo : "<<arrayname<<" "<<"id : "<<compid<<" , newcompname = "<<newcompname<<std::endl;
+
+ vtkInternals::ArraysType::iterator it = this->Internals->Arrays.find(arrayname);
+
+ if ( it == this->Internals->Arrays.end() ) {
+ vtkInternals::ArraysType::iterator it1 = this->Internals->Arrays.begin();
+ for( ; it1 != this->Internals->Arrays.end(); it1 ++ ) {
+ if( it1->second.NewName.compare(arrayname) == 0 ) {
+ it = it1;
+ break;
+ }
+ }
+ }
+
+ if( it == this->Internals->Arrays.end() ) {
+ std::pair<vtkInternals::ArraysType::iterator,bool> ret;
+ ret = this->Internals->Arrays.insert ( std::pair<std::string, vtkInternals::ArrayInfo>( arrayname, vtkInternals::ArrayInfo() ) );
+ it = ret.first;
+ }
+
+ if( it != this->Internals->Arrays.end() ) {
+ vtkInternals::ComponentsInfo::iterator vect_it = it->second.ComponentVector.begin();
+ for( ; vect_it != it->second.ComponentVector.end(); vect_it++ ) {
+ if ( vect_it->first == compid )
+ break;
+ }
+
+ if ( vect_it != it->second.ComponentVector.end() ) {
+ vect_it->second = newcompname;
+ } else {
+ it->second.ComponentVector.push_back( std::pair<int,std::string>( compid,newcompname ) );
+ }
+ }
+ this->Modified();
+}
+
+void vtkArrayRenamerFilter::SetArrayInfo( const char* originarrayname, const char* newarrayname, bool copy ) {
+
+ //std::cout<<"vtkArrayRenamerFilter::SetArrayInfo : "<<originarrayname<<" "<<"new name :"<<newarrayname<<" , copy = "<<copy<<std::endl;
+
+ vtkInternals::ArraysType::iterator it = this->Internals->Arrays.find(originarrayname);
+
+ if ( it == this->Internals->Arrays.end() )
+ this->Internals->Arrays.insert ( std::pair<std::string, vtkInternals::ArrayInfo>( originarrayname, vtkInternals::ArrayInfo() ) );
+
+ this->Internals->Arrays[originarrayname].NewName = newarrayname;
+ this->Internals->Arrays[originarrayname].CopyArray = copy;
+ this->Modified();
+}
+
+void vtkArrayRenamerFilter::ClearArrayInfo() {
+ //std::cout<<"vtkArrayRenamerFilter::ClearArrayInfo"<<std::endl;
+ this->Internals->Arrays.clear();
+ this->Modified();
+}
+
+void vtkArrayRenamerFilter::ClearComponentsInfo() {
+ //std::cout<<"vtkArrayRenamerFilter::ClearComponentsInfo"<<std::endl;
+ vtkInternals::ArraysType::iterator it = this->Internals->Arrays.begin();
+ for( ; it != this->Internals->Arrays.end(); it ++ ){
+ it->second.ComponentVector.clear();
+ }
+ this->Modified();
+}
--- /dev/null
+// Copyright (C) 2014-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 : Roman NIKOLAEV
+
+#ifndef __ArrayRenamerFilter_h_
+#define __ArrayRenamerFilter_h_
+
+#include <vtkDataSetAlgorithm.h>
+
+/**
+ * Description of class:
+ * Class allows to rename data arrays and array's components.
+*/
+class VTK_EXPORT vtkArrayRenamerFilter : public vtkDataSetAlgorithm
+{
+public:
+ /// Returns pointer on a new instance of the class
+ static vtkArrayRenamerFilter* New();
+
+ vtkTypeMacro( vtkArrayRenamerFilter, vtkDataSetAlgorithm );
+
+ void SetArrayInfo( const char* originarrayname, const char* newarrayname, bool copy );
+ void ClearArrayInfo();
+
+ void SetComponentInfo( const char* arrayname, const int compid, const char* newarrayname );
+ void ClearComponentsInfo();
+protected:
+ /// Constructor & destructor
+ vtkArrayRenamerFilter();
+ virtual ~vtkArrayRenamerFilter();
+
+ virtual int RequestData( vtkInformation *,
+ vtkInformationVector **,
+ vtkInformationVector * );
+private:
+ vtkArrayRenamerFilter( const vtkArrayRenamerFilter & ); // Not implemented yet
+ void operator=( const vtkArrayRenamerFilter & ); // Not implemented yet
+
+ void FillListOfArrays( vtkDataObject* );
+
+ class vtkInternals;
+ friend class vtkInternals;
+ vtkInternals* Internals;
+
+};
+
+#endif // __ArrayRenamerFilter_h_
ScaleVector
EllipseBuilder
DifferenceTimesteps
+ ArrayRenamer
)
IF(NOT SALOME_LIGHT_ONLY)
<ParaViewFilters>
<Filter name="ExtractGroup"/>
<Filter name="ExtractCellType"/>
- <Category name="Integration Points" menu_label="&Integration Points" preserve_order="1">
+ <Category name="Mechanics" menu_label="&Mechanics" preserve_order="1">
<Filter name="ELNOPoints"/>
<Filter name="ELNOMesh"/>
<Filter name="ELNOSurface"/>
#
ADD_SUBDIRECTORY(VisuPrs)
+ADD_SUBDIRECTORY(standalone)
SET(_demo_files
demo0.py
--- /dev/null
+# 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)
+
+PROJECT(LightPARAVIS)
+CMAKE_MINIMUM_REQUIRED(VERSION 2.8.10)
+
+SET(CMAKE_BUILD_TYPE "Debug")
+
+FIND_PACKAGE(Qt4 REQUIRED)
+
+LIST(APPEND CMAKE_PREFIX_PATH "$ENV{PARAVIEW_ROOT_DIR}")
+FIND_PACKAGE(ParaView 4.3 REQUIRED)
+
+INCLUDE(${PARAVIEW_USE_FILE})
+INCLUDE(ParaViewMacros)
+
+# Main application
+ADD_SUBDIRECTORY(src)
--- /dev/null
+# 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)
+#INSTALL(TARGET paraLight bin)
+
--- /dev/null
+// 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 <iostream>
+#include <QObject>
+#include <QtGui/QFileDialog>
+#include <QMessageBox>
+
+#include <pqTabbedMultiViewWidget.h>
+#include <pqApplicationCore.h>
+#include <pqPVApplicationCore.h>
+#include <pqObjectBuilder.h>
+#include <pqLoadDataReaction.h>
+#include <pqPipelineSource.h>
+#include <pqManagePluginsReaction.h>
+#include <pqPropertiesPanel.h>
+#include <pqPipelineBrowserWidget.h>
+#include <pqServerManagerModel.h>
+#include <pqRenderView.h>
+#include <pqActiveObjects.h>
+#include <pqProxy.h>
+
+#include <vtkSMSourceProxy.h>
+#include <vtkSMProperty.h>
+#include <vtkSMStringVectorProperty.h>
+
+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<PLViewTab *>(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<pqPipelineSource *> 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());
+}
--- /dev/null
+// 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 <QMainWindow>
+#include "ui_light_para.h"
+#include <QStack>
+
+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<pqPipelineSource *> _simplePipeline;
+
+ bool _autoApply;
+};
+
+#endif /* PLVIEWWIDGET_H_ */
--- /dev/null
+// 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 <iostream>
+#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;
+}
+
--- /dev/null
+// 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_ */
--- /dev/null
+// 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 <QMainWindow>
+
+#include <pqInterfaceTracker.h>
+#include <pqApplicationCore.h>
+#include <pqPluginManager.h>
+#include <pqStandardPropertyWidgetInterface.h>
+#include <pqStandardViewFrameActionsImplementation.h>
+#include <pqPropertiesPanel.h>
+
+#include <pqAlwaysConnectedBehavior.h>
+#include <pqAutoLoadPluginXMLBehavior.h>
+#include <pqCommandLineOptionsBehavior.h>
+#include <pqCrashRecoveryBehavior.h>
+#include <pqDataTimeStepBehavior.h>
+#include <pqDefaultViewBehavior.h>
+#include <pqObjectPickingBehavior.h>
+#include <pqPersistentMainWindowStateBehavior.h>
+#include <pqPipelineContextMenuBehavior.h>
+#include <pqPluginActionGroupBehavior.h>
+#include <pqPluginDockWidgetsBehavior.h>
+#include <pqSpreadSheetVisibilityBehavior.h>
+#include <pqUndoRedoBehavior.h>
+#include <pqViewStreamingBehavior.h>
+#include <pqCollaborationBehavior.h>
+#include <pqVerifyRequiredPluginBehavior.h>
+#include <pqPluginSettingsBehavior.h>
+#include <pqFixPathsInStateFilesBehavior.h>
+#include <pqApplyBehavior.h>
+
+#include <pqPropertiesPanel.h>
+
+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<pqPropertiesPanel*>())
+ {
+ applyBehavior->registerPanel(ppanel);
+ }
+ BehaviorLoadingLevel = 2;
+ }
+}
--- /dev/null
+// 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 <QObject>
+
+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_ */
--- /dev/null
+// 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 <QApplication>
+#include <QStringList>
+#include <QDir>
+#include <QMainWindow>
+
+#include <string>
+
+#include <pqOptions.h>
+#include <pqSettings.h>
+#include <pqPVApplicationCore.h>
+#include <pqTabbedMultiViewWidget.h>
+#include <pqParaViewMenuBuilders.h>
+#include <pqActiveObjects.h>
+#include <pqPipelineBrowserWidget.h>
+#include <pqServerDisconnectReaction.h>
+
+
+//---------- 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();
+}
+
--- /dev/null
+// 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 <QString>
+
+class PVViewer_EngineWrapper;
+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_ */
--- /dev/null
+// 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 <iostream>
+
+#include "PVViewer_GUIElements.h"
+#include "PVViewer_Core.h"
+
+#include <pqPVApplicationCore.h>
+#include <pqActiveObjects.h>
+#include <pqObjectBuilder.h>
+
+#include <pqPropertiesPanel.h>
+#include <pqPipelineBrowserWidget.h>
+#include <pqTabbedMultiViewWidget.h>
+#include <pqParaViewMenuBuilders.h>
+#include <pqMainControlsToolbar.h>
+#include <pqVCRToolbar.h>
+#include <pqAnimationTimeToolbar.h>
+#include <pqColorToolbar.h>
+#include <pqRepresentationToolbar.h>
+#include <pqCameraToolbar.h>
+#include <pqAxesToolbar.h>
+#include <pqSetName.h>
+
+#include <pqPythonManager.h>
+#include <pqApplicationCore.h>
+
+#include <QMainWindow>
+#include <QMenu>
+#include <QList>
+#include <QAction>
+#include <QToolBar>
+#include <QLayout>
+
+#include <QCoreApplication>
+
+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<pqTabbedMultiViewWidget*>(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<pqPythonManager*>(
+ 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<QToolBar*> PVViewer_GUIElements::getToolbars()
+{
+ QList<QToolBar*> 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);
+}
--- /dev/null
+// 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 <QObject>
+#include <QList>
+
+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<QToolBar*> 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_ */
--- /dev/null
+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).
--- /dev/null
+// 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 <iostream>
+
+#include "PVViewer_Core.h"
+#include "PVViewer_Behaviors.h"
+#include "PLMainWindow.hxx"
+
+#include <pqApplicationCore.h>
+#include <pqSettings.h>
+#include <pqParaViewBehaviors.h>
+#include <pqServerResource.h>
+#include <pqServerConnectReaction.h>
+#include <pqServerDisconnectReaction.h>
+
+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;
+}
+
+
+
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>MainWindow</class>
+ <widget class="QMainWindow" name="MainWindow">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>1010</width>
+ <height>678</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>PARAVIS Light!</string>
+ </property>
+ <widget class="QWidget" name="centralwidget">
+ <layout class="QVBoxLayout" name="verticalLayout_2">
+ <item>
+ <widget class="QSplitter" name="splitter_2">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <widget class="QSplitter" name="splitter">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <widget class="QFrame" name="pipelineFrame">
+ <property name="frameShape">
+ <enum>QFrame::StyledPanel</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>QFrame::Raised</enum>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayoutPipe">
+ <item>
+ <widget class="QWidget" name="widget" native="true"/>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QFrame" name="propFrame">
+ <property name="frameShape">
+ <enum>QFrame::StyledPanel</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>QFrame::Raised</enum>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayoutProp">
+ <item>
+ <widget class="QWidget" name="widget_2" native="true"/>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ <widget class="QTabWidget" name="tabWidget">
+ <property name="currentIndex">
+ <number>-1</number>
+ </property>
+ </widget>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>Chosen file:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="currentFileLabel">
+ <property name="readOnly">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="openButton">
+ <property name="text">
+ <string>Open ...</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_4">
+ <item>
+ <spacer name="horizontalSpacer_6">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QPushButton" name="addTabButton">
+ <property name="text">
+ <string>Add tab ...</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_7">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QPushButton" name="detTabButton">
+ <property name="text">
+ <string>Delete current tab</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_8">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_2">
+ <item>
+ <spacer name="horizontalSpacer">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QPushButton" name="pluginsButton">
+ <property name="text">
+ <string>Manage Plugins ...</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_5">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QPushButton" name="sliceButton">
+ <property name="text">
+ <string>Slice</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_3">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QPushButton" name="shrinkButton">
+ <property name="text">
+ <string>Shrink</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_4">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QPushButton" name="quitButton">
+ <property name="text">
+ <string> Quit </string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_2">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QMenuBar" name="menubar">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>1010</width>
+ <height>22</height>
+ </rect>
+ </property>
+ <widget class="QMenu" name="menuFile">
+ <property name="title">
+ <string>File</string>
+ </property>
+ <addaction name="actionOpen_file"/>
+ <addaction name="actionQuit"/>
+ </widget>
+ <widget class="QMenu" name="menuSimple_actions">
+ <property name="title">
+ <string>Simple actions</string>
+ </property>
+ <addaction name="actionSlice"/>
+ <addaction name="actionShrink"/>
+ </widget>
+ <widget class="QMenu" name="menuTabs">
+ <property name="title">
+ <string>Tabs</string>
+ </property>
+ <addaction name="actionAdd_tab"/>
+ <addaction name="actionDelete_tab"/>
+ </widget>
+ <widget class="QMenu" name="menuOptions">
+ <property name="title">
+ <string>Options</string>
+ </property>
+ <addaction name="actionAuto_apply"/>
+ <addaction name="actionShow_prop_widget"/>
+ <addaction name="actionShow_pipeline"/>
+ </widget>
+ <addaction name="menuFile"/>
+ <addaction name="menuSimple_actions"/>
+ <addaction name="menuOptions"/>
+ <addaction name="menuTabs"/>
+ </widget>
+ <widget class="QStatusBar" name="statusbar"/>
+ <action name="actionOpen_file">
+ <property name="text">
+ <string>Open file ...</string>
+ </property>
+ </action>
+ <action name="actionQuit">
+ <property name="text">
+ <string>Quit</string>
+ </property>
+ </action>
+ <action name="actionSlice">
+ <property name="text">
+ <string>Slice</string>
+ </property>
+ </action>
+ <action name="actionShrink">
+ <property name="text">
+ <string>Shrink</string>
+ </property>
+ </action>
+ <action name="actionAdd_tab">
+ <property name="text">
+ <string>Add tab</string>
+ </property>
+ </action>
+ <action name="actionDelete_tab">
+ <property name="text">
+ <string>Delete tab</string>
+ </property>
+ </action>
+ <action name="actionAuto_apply">
+ <property name="checkable">
+ <bool>true</bool>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ <property name="text">
+ <string>Auto apply</string>
+ </property>
+ </action>
+ <action name="actionShow_prop_widget">
+ <property name="checkable">
+ <bool>true</bool>
+ </property>
+ <property name="checked">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Show prop widget</string>
+ </property>
+ </action>
+ <action name="actionShow_pipeline">
+ <property name="checkable">
+ <bool>true</bool>
+ </property>
+ <property name="checked">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Show pipeline</string>
+ </property>
+ </action>
+ </widget>
+ <resources/>
+ <connections>
+ <connection>
+ <sender>quitButton</sender>
+ <signal>clicked()</signal>
+ <receiver>MainWindow</receiver>
+ <slot>close()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>871</x>
+ <y>588</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>439</x>
+ <y>210</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>openButton</sender>
+ <signal>clicked()</signal>
+ <receiver>MainWindow</receiver>
+ <slot>onFileOpen()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>1004</x>
+ <y>271</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>456</x>
+ <y>258</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>MainWindow</sender>
+ <signal>changedCurrentFile(QString)</signal>
+ <receiver>currentFileLabel</receiver>
+ <slot>setText(QString)</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>456</x>
+ <y>258</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>211</x>
+ <y>259</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>shrinkButton</sender>
+ <signal>clicked()</signal>
+ <receiver>MainWindow</receiver>
+ <slot>shrink()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>674</x>
+ <y>588</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>456</x>
+ <y>258</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>sliceButton</sender>
+ <signal>clicked()</signal>
+ <receiver>MainWindow</receiver>
+ <slot>slice()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>472</x>
+ <y>588</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>504</x>
+ <y>338</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>pluginsButton</sender>
+ <signal>clicked()</signal>
+ <receiver>MainWindow</receiver>
+ <slot>managePlugins()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>279</x>
+ <y>588</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>504</x>
+ <y>338</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>actionSlice</sender>
+ <signal>triggered()</signal>
+ <receiver>MainWindow</receiver>
+ <slot>slice()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>-1</x>
+ <y>-1</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>504</x>
+ <y>338</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>actionShrink</sender>
+ <signal>triggered()</signal>
+ <receiver>MainWindow</receiver>
+ <slot>shrink()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>-1</x>
+ <y>-1</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>504</x>
+ <y>338</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>actionOpen_file</sender>
+ <signal>triggered()</signal>
+ <receiver>MainWindow</receiver>
+ <slot>onFileOpen()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>-1</x>
+ <y>-1</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>504</x>
+ <y>338</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>actionQuit</sender>
+ <signal>triggered()</signal>
+ <receiver>MainWindow</receiver>
+ <slot>close()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>-1</x>
+ <y>-1</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>504</x>
+ <y>338</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>actionAdd_tab</sender>
+ <signal>triggered()</signal>
+ <receiver>MainWindow</receiver>
+ <slot>addTab()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>-1</x>
+ <y>-1</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>504</x>
+ <y>338</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>actionDelete_tab</sender>
+ <signal>triggered()</signal>
+ <receiver>MainWindow</receiver>
+ <slot>deleteTab()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>-1</x>
+ <y>-1</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>504</x>
+ <y>338</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>addTabButton</sender>
+ <signal>clicked()</signal>
+ <receiver>MainWindow</receiver>
+ <slot>addTab()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>350</x>
+ <y>430</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>504</x>
+ <y>338</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>detTabButton</sender>
+ <signal>clicked()</signal>
+ <receiver>MainWindow</receiver>
+ <slot>deleteTab()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>750</x>
+ <y>430</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>504</x>
+ <y>338</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>actionAuto_apply</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>MainWindow</receiver>
+ <slot>autoApplyCheck(bool)</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>-1</x>
+ <y>-1</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>504</x>
+ <y>338</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>actionShow_pipeline</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>MainWindow</receiver>
+ <slot>showPipeline(bool)</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>-1</x>
+ <y>-1</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>504</x>
+ <y>338</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>actionShow_prop_widget</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>MainWindow</receiver>
+ <slot>showProp(bool)</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>-1</x>
+ <y>-1</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>504</x>
+ <y>338</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>tabWidget</sender>
+ <signal>currentChanged(int)</signal>
+ <receiver>MainWindow</receiver>
+ <slot>currentTabChanged(int)</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>894</x>
+ <y>101</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>504</x>
+ <y>338</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+ <slots>
+ <signal>changedCurrentFile(QString)</signal>
+ <slot>onFileOpen()</slot>
+ <slot>slice()</slot>
+ <slot>shrink()</slot>
+ <slot>managePlugins()</slot>
+ <slot>addTab()</slot>
+ <slot>deleteTab()</slot>
+ <slot>autoApplyCheck(bool)</slot>
+ <slot>showPipeline(bool)</slot>
+ <slot>showProp(bool)</slot>
+ <slot>currentTabChanged(int)</slot>
+ </slots>
+</ui>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>ViewTab</class>
+ <widget class="QWidget" name="ViewTab">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>550</width>
+ <height>620</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Form</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout_2">
+ <item>
+ <widget class="QFrame" name="frameButtons">
+ <property name="frameShape">
+ <enum>QFrame::StyledPanel</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>QFrame::Raised</enum>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <spacer name="verticalSpacer_2">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>243</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLabel" name="label">
+ <property name="font">
+ <font>
+ <weight>75</weight>
+ <bold>true</bold>
+ </font>
+ </property>
+ <property name="layoutDirection">
+ <enum>Qt::LeftToRight</enum>
+ </property>
+ <property name="text">
+ <string>Choose what to display:</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignCenter</set>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="showTabbedButton">
+ <property name="text">
+ <string>Tabbed multi-view widget</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="singleViewButton">
+ <property name="text">
+ <string>Single render view</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="verticalSpacer">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QFrame" name="frameView">
+ <property name="frameShape">
+ <enum>QFrame::StyledPanel</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>QFrame::Raised</enum>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayoutView">
+ <item>
+ <widget class="QWidget" name="widget" native="true"/>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections>
+ <connection>
+ <sender>singleViewButton</sender>
+ <signal>clicked()</signal>
+ <receiver>ViewTab</receiver>
+ <slot>insertSingleView()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>170</x>
+ <y>262</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>170</x>
+ <y>239</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>showTabbedButton</sender>
+ <signal>clicked()</signal>
+ <receiver>ViewTab</receiver>
+ <slot>insertMultiView()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>170</x>
+ <y>234</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>170</x>
+ <y>239</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+ <slots>
+ <slot>insertMultiView()</slot>
+ <slot>insertSingleView()</slot>
+ </slots>
+</ui>
--- /dev/null
+<ParaViewReaders>
+ <!--
+ NOTE: Readers are tried in reverse order that they are present in this
+ list i.e. if two readers can read the same extension, then the reader
+ apperaring later will be tried first when reading the file.
+ -->
+ <ProxyManager type="reader" />
+ <Proxy group="sources" name="LSDynaReader" />
+ <Proxy group="sources" name="PVDReader" />
+ <Proxy group="sources" name="XMLHierarchicalBoxDataReader" />
+ <Proxy group="sources" name="XMLPolyDataReader"/>
+ <Proxy group="sources" name="XMLUnstructuredGridReader" />
+ <Proxy group="sources" name="XMLImageDataReader" />
+ <Proxy group="sources" name="XMLStructuredGridReader" />
+ <Proxy group="sources" name="XMLRectilinearGridReader" />
+ <Proxy group="sources" name="XMLPPolyDataReader" />
+ <Proxy group="sources" name="XMLPUnstructuredGridReader" />
+ <Proxy group="sources" name="XMLPImageDataReader" />
+ <Proxy group="sources" name="XMLPStructuredGridReader" />
+ <Proxy group="sources" name="XMLPRectilinearGridReader" />
+ <Proxy group="sources" name="XMLMultiBlockDataReader" />
+ <Proxy group="sources" name="XMLUniformGridAMRReader" />
+ <Proxy group="sources" name="LegacyVTKFileReader" />
+ <Proxy group="sources" name="pvtkfile" />
+ <Proxy group="sources" name="ensight" />
+ <Proxy group="sources" name="ensightMS" />
+ <Proxy group="sources" name="TecplotReader" />
+ <Proxy group="sources" name="netCDFReader" />
+ <Proxy group="sources" name="byureader" />
+ <Proxy group="sources" name="objreader" />
+ <Proxy group="sources" name="ProStarReader" />
+ <Proxy group="sources" name="XdmfReader" />
+ <Proxy group="sources" name="pdbreader" />
+ <Proxy group="sources" name="xyzreader" />
+ <Proxy group="sources" name="P3DReader" />
+ <Proxy group="sources" name="Plot3DMetaReader"/>
+ <Proxy group="sources" name="spcthreader" />
+ <Proxy group="sources" name="SPCTHRestartReader" />
+ <Proxy group="sources" name="spcthhistoryreader" />
+ <Proxy group="sources" name="DEMReader" />
+ <Proxy group="sources" name="vrmlreader" />
+ <Proxy group="sources" name="plyreader" />
+ <Proxy group="sources" name="stlreader" />
+ <Proxy group="sources" name="gaussiancubereader" />
+ <Proxy group="sources" name="ImageReader" />
+ <Proxy group="sources" name="popreader"/>
+ <Proxy group="sources" name="AVSucdSeriesReader" />
+ <Proxy group="sources" name="MetaImageReader" />
+ <Proxy group="sources" name="NrrdReader" />
+ <Proxy group="sources" name="FacetReader" />
+ <Proxy group="sources" name="PNGSeriesReader" />
+ <Proxy group="sources" name="JPEGSeriesReader" />
+ <Proxy group="sources" name="TIFFSeriesReader" />
+ <Proxy group="sources" name="PhastaReader" />
+ <Proxy group="sources" name="EnzoReader" />
+ <Proxy group="sources" name="FlashReader" />
+ <Proxy group="sources" name="SESAMEReader" />
+ <Proxy group="sources" name="CSVReader" />
+ <Proxy group="sources" name="MFIXReader" />
+ <Proxy group="sources" name="FLUENTReader" />
+ <Proxy group="sources" name="OpenFOAMReader" />
+ <Proxy group="sources" name="CosmoReader" />
+ <Proxy group="sources" name="SiloReader"/>
+ <Proxy group="sources" name="ExodusIIReader" />
+ <Proxy group="sources" name="ExodusRestartReader" />
+ <Proxy group="sources" name="SLACReader" />
+ <Proxy group="sources" name="SLACParticleReader" />
+ <Proxy group="sources" name="ParticleReader" />
+ <Proxy group="sources" name="VPICReader" />
+ <Proxy group="sources" name="WindBladeReader" />
+ <Proxy group="sources" name="NetCDFCAMReader" />
+ <Proxy group="sources" name="NetCDFPOPReader" />
+ <Proxy group="sources" name="UnstructuredPOPReader" />
+ <Proxy group="sources" name="PNetCDFPOPReader" />
+ <Proxy group="sources" name="MPASReader" />
+ <Proxy group="sources" name="EnzoParticlesReader" />
+ <Proxy group="sources" name="FlashParticlesReader" />
+ <Proxy group="sources" name="CMLMoleculeReader"/>
+</ParaViewReaders>