From 68089dd57468ee7729062d38f6f3a2a54a7ea786 Mon Sep 17 00:00:00 2001 From: Will Bainbridge Date: Tue, 18 Jul 2017 14:42:30 +0100 Subject: [PATCH] paraFoam: Updated ParaView to version 5.4.0 ParaView has been updated to version 5.4.0. The C++ panel has been deleted and replaced with a panel based on the new(er) XML API. This reader works for ParaView-4.0.1 and newer. The ParaView 3 reader remains unchanged. Update issues have also been fixed. All the time directories are now scanned for fields and clouds when filling the selection lists. This stops fields from disappearing when the time is changed. The scan is only done on startup and when the refresh button is pressed. The list of available Lagrangian fields also now shows a combined set of all the clouds. Previously, only fields from the first cloud were shown. If a field does not apply to all the clouds, ParaView will display it's name in the dropdown menu with a "(partial)" qualifier. Some undocumented and incomplete bits of code, which were not being compiled, have been removed. --- .../PVFoamReader/PVFoamReader/CMakeLists.txt | 47 +- .../PVFoamReader/PVFoamReader.qrc | 5 - .../PVFoamReader/PVFoamReader_SM.xml | 573 +++++++++--------- .../PVFoamReader/pqPVFoamReaderPanel.cxx | 485 --------------- .../PVFoamReader/pqPVFoamReaderPanel.h | 116 ---- .../PVFoamReader/vtkPVFoamReader.cxx | 98 +-- .../PVFoamReader/vtkPVFoamReader.h | 12 +- .../PVFoamReader/vtkPVFoam/vtkPVFoam.C | 9 - .../PVFoamReader/vtkPVFoam/vtkPVFoam.H | 4 +- .../vtkPVFoam/vtkPVFoamUpdateInfo.C | 107 ++-- .../vtkPVFoam/vtkPVFoamUpdateInfoFields.H | 62 +- .../PVblockMeshReader/CMakeLists.txt | 51 +- .../PVblockMeshReader/PVblockMeshReader.qrc | 5 - .../PVblockMeshReader_SM.xml | 203 +++---- .../pqPVblockMeshReaderPanel.cxx | 143 ----- .../pqPVblockMeshReaderPanel.h | 86 --- .../vtkPVblockMeshReader.cxx | 4 +- .../PVblockMeshReader/vtkPVblockMeshReader.h | 4 +- etc/config.csh/paraview | 5 +- etc/config.sh/paraview | 5 +- 20 files changed, 510 insertions(+), 1514 deletions(-) delete mode 100644 applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader/PVFoamReader.qrc delete mode 100644 applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader/pqPVFoamReaderPanel.cxx delete mode 100644 applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader/pqPVFoamReaderPanel.h delete mode 100644 applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/PVblockMeshReader.qrc delete mode 100644 applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/pqPVblockMeshReaderPanel.cxx delete mode 100644 applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/pqPVblockMeshReaderPanel.h diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader/CMakeLists.txt b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader/CMakeLists.txt index a07767676..d8a66b793 100644 --- a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader/CMakeLists.txt +++ b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader/CMakeLists.txt @@ -1,12 +1,4 @@ -# create a plugin that adds a reader to the ParaView GUI -# it is added in the file dialog when doing opens/saves. - -# The qrc file is processed by Qt's resource compiler (rcc) -# the qrc file must have a resource prefix of "/ParaViewResources" -# and ParaView will read anything contained under that prefix -# the pqReader.xml file contains xml defining readers with their -# file extensions and descriptions. - +# Set up the environment CMAKE_MINIMUM_REQUIRED(VERSION 2.8) FIND_PACKAGE(ParaView REQUIRED) @@ -30,6 +22,7 @@ ADD_DEFINITIONS( -DWM_LABEL_SIZE=$ENV{WM_LABEL_SIZE} ) + # Set output library destination to plugin directory SET( LIBRARY_OUTPUT_PATH $ENV{PV_PLUGIN_PATH} @@ -37,44 +30,26 @@ SET( "Single output directory for building all libraries." ) - -# -# Defined combined plugin -# - -# Extend the auto-generated panel -QT4_WRAP_CPP(MOC_SRCS pqPVFoamReaderPanel.h) - -ADD_PARAVIEW_OBJECT_PANEL(IFACES IFACE_SRCS - CLASS_NAME pqPVFoamReaderPanel - XML_NAME PVFoamReader # name of SourceProxy in *SM.xml - XML_GROUP sources -) - +# Add the plugin. ParaView-4.0.? requires a GUI_RESOURCE_FILES XML file. As of +# version 4.1.? this is no longer needed. IF("${PARAVIEW_VERSION_MAJOR}.${PARAVIEW_VERSION_MINOR}" EQUAL 4.0) - - # Special build options, specifically for ParaView 4.0.* - # Because as of 4.1.0, GUI_RESOURCE_FILES is no longer used. ADD_PARAVIEW_PLUGIN( - PVFoamReader_SM "1.0" + PVFoamReader_SM + "1.0" SERVER_MANAGER_XML PVFoamReader_SM.xml SERVER_MANAGER_SOURCES vtkPVFoamReader.cxx - GUI_INTERFACES ${IFACES} - GUI_SOURCES pqPVFoamReaderPanel.cxx - ${MOC_SRCS} ${UI_SRCS} ${IFACE_SRCS} GUI_RESOURCE_FILES PVFoamReader.xml ) -ELSE("${PARAVIEW_VERSION_MAJOR}.${PARAVIEW_VERSION_MINOR}" EQUAL 4.0) +ELSE() ADD_PARAVIEW_PLUGIN( - PVFoamReader_SM "1.0" + PVFoamReader_SM + "1.0" SERVER_MANAGER_XML PVFoamReader_SM.xml SERVER_MANAGER_SOURCES vtkPVFoamReader.cxx - GUI_INTERFACES ${IFACES} - GUI_SOURCES pqPVFoamReaderPanel.cxx - ${MOC_SRCS} ${UI_SRCS} ${IFACE_SRCS} ) -ENDIF("${PARAVIEW_VERSION_MAJOR}.${PARAVIEW_VERSION_MINOR}" EQUAL 4.0) +ENDIF() +# Build the client-side plugin TARGET_LINK_LIBRARIES( PVFoamReader_SM LINK_PUBLIC diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader/PVFoamReader.qrc b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader/PVFoamReader.qrc deleted file mode 100644 index 9bb30ea5c..000000000 --- a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader/PVFoamReader.qrc +++ /dev/null @@ -1,5 +0,0 @@ - - - PVFoamReader.xml - - diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader/PVFoamReader_SM.xml b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader/PVFoamReader_SM.xml index 69bcfc096..612b5837c 100644 --- a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader/PVFoamReader_SM.xml +++ b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader/PVFoamReader_SM.xml @@ -1,309 +1,308 @@ - - + + - - - - - Specifies the filename for the OpenFOAM Reader. - - + + + + + Available times + + - - - - - Available timestep values. - - + + + + + The file name + + - - - - - Cache the fvMesh in memory. - - + + + + Rescan for updated times and fields + + - - - - - Rescan for updated timesteps/fields. - - + + + + + Cache the mesh in memory + + - - - - - Skip including the 0/ time directory - - + + + + + Represent cells as general polyhedra instead of decomposing + them into simpler shapes + + - - - - - Interpolate volume fields into point fields - - + + + + + Do not load the zero time directory + + - - - - - Extrapolate internalField to non-constraint patches - - + + + + + Interpolate volume fields to the points + + - - - - - Use vtkPolyhedron instead of decomposing polyhedra. - - + + + + + Extrapolate volume fields to non-constraint patches + + - - - - Search the polyMesh/sets/ directory - - - + + + + + Show patch names in the visualisation + + - - - - ZoneMesh information is used to find {cell,face,point}Zones. - The polyMesh/ directory is only checked on startup. - - - + - - - - - Show patch names in render window - - + + + + Allow selection of sets + + + - - - - - Show groups only - - + + + + Allow selection of zones + + + - - - - - A simple way to cause a reader GUI modification. - - + + + + + Show only patch groups, not individual patches + + - + + + + + + + + + + + + Select the parts of the mesh to load + + - - - - - - - - - - - - This property contains a list of the mesh parts - (patches, groups, sets, zones). - - + + + + + + + + + + + + Select volume fields to load + + - - - - - - - - - - - - This property contains a list of the volume fields - - + + + + + + + + + + + + Select Lagrangain fields to load + + - - - - - - - - - - - - This property contains a list of the lagrangian fields - - + + + + + + + + + + + + Select point fields to load + + - - - - - - - - - - - - This property contains a list of the point fields - - + + + + + + + + + + + + + - - - - - - - - - - - + + + - - - + + diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader/pqPVFoamReaderPanel.cxx b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader/pqPVFoamReaderPanel.cxx deleted file mode 100644 index 521068d40..000000000 --- a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader/pqPVFoamReaderPanel.cxx +++ /dev/null @@ -1,485 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM 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 General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -\*---------------------------------------------------------------------------*/ - -#include "pqPVFoamReaderPanel.h" - -// QT -#include -#include -#include -#include -#include -#include -#include - -// Paraview <-> QT UI -#include "pqAnimationScene.h" -#include "pqApplicationCore.h" -#include "pqPipelineRepresentation.h" -#include "pqServerManagerModel.h" -#include "pqView.h" - -// Paraview Server Manager -#include "vtkSMDoubleVectorProperty.h" -#include "vtkSMIntVectorProperty.h" -#include "vtkSMProperty.h" -#include "vtkSMSourceProxy.h" - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -pqPVFoamReaderPanel::pqPVFoamReaderPanel -( - pqProxy *proxy, - QWidget *p -) -: - pqAutoGeneratedObjectPanel(proxy, p) -{ - // create first sublayout (at top of the panel) - QGridLayout* form = new QGridLayout(); - this->PanelLayout->addLayout(form, 0, 0, 1, -1); - - // ROW 0 - // ~~~~~ - - vtkSMProperty* prop = 0; - - // refresh button for updating times/fields - if ((prop = this->proxy()->GetProperty("UiRefresh")) != 0) - { - prop->SetImmediateUpdate(1); - QPushButton* refresh = new QPushButton("Refresh Times"); - refresh->setToolTip("Rescan for updated times/fields."); - - form->addWidget(refresh, 0, 0, Qt::AlignLeft); - QObject::connect - ( - refresh, - SIGNAL(clicked()), - this, - SLOT(RefreshPressed()) - ); - } - - // checkbox for skip zeroTime - if ((prop = this->proxy()->GetProperty("UiZeroTime")) != 0) - { - // immediate update on the Server Manager side - prop->SetImmediateUpdate(true); - - ZeroTime_ = new QCheckBox("Skip Zero Time"); - ZeroTime_->setChecked - ( - vtkSMIntVectorProperty::SafeDownCast(prop)->GetElement(0) - ); - ZeroTime_->setToolTip - ( - "Skip including the 0/ time directory." - ); - - form->addWidget(ZeroTime_, 0, 1, Qt::AlignLeft); - connect - ( - ZeroTime_, - SIGNAL(stateChanged(int)), - this, - SLOT(ZeroTimeToggled()) - ); - } - - // ROW 1 - // ~~~~~ - - QFrame* hline1 = new QFrame(this); - hline1->setFrameStyle(QFrame::HLine | QFrame::Sunken); - form->addWidget(hline1, 1, 0, 1, 3); - - // ROW 2 - // ~~~~~ - - // checkbox for caching mesh - if ((prop = this->proxy()->GetProperty("UiCacheMesh")) != 0) - { - // immediate update on the Server Manager side - prop->SetImmediateUpdate(true); - - CacheMesh_ = new QCheckBox("Cache Mesh"); - CacheMesh_->setChecked - ( - vtkSMIntVectorProperty::SafeDownCast(prop)->GetElement(0) - ); - CacheMesh_->setToolTip - ( - "Cache the fvMesh in memory." - ); - - form->addWidget(CacheMesh_, 2, 0, Qt::AlignLeft); - connect - ( - CacheMesh_, - SIGNAL(stateChanged(int)), - this, - SLOT(CacheMeshToggled()) - ); - } - - // cell 2,1 empty - - // ROW 3 - // ~~~~~ - - // checkbox for include sets - if ((prop = this->proxy()->GetProperty("UiIncludeSets")) != 0) - { - // immediate update on the Server Manager side - prop->SetImmediateUpdate(true); - - IncludeSets_ = new QCheckBox("Include Sets"); - IncludeSets_->setChecked - ( - vtkSMIntVectorProperty::SafeDownCast(prop)->GetElement(0) - ); - IncludeSets_->setToolTip - ( - "Search the polyMesh/sets/ directory." - ); - - // row/col 1,0 - form->addWidget(IncludeSets_, 3, 0, Qt::AlignLeft); - connect - ( - IncludeSets_, - SIGNAL(stateChanged(int)), - this, - SLOT(IncludeSetsToggled()) - ); - } - - // checkbox for Groups Only - if ((prop = this->proxy()->GetProperty("UiShowGroupsOnly")) != 0) - { - // immediate update on the Server Manager side - prop->SetImmediateUpdate(true); - - ShowGroupsOnly_ = new QCheckBox("Groups Only"); - ShowGroupsOnly_->setChecked - ( - vtkSMIntVectorProperty::SafeDownCast(prop)->GetElement(0) - ); - ShowGroupsOnly_->setToolTip - ( - "Show patchGroups only." - ); - - // row/col 2, 2 - form->addWidget(ShowGroupsOnly_, 3, 1, Qt::AlignLeft); - connect - ( - ShowGroupsOnly_, - SIGNAL(stateChanged(int)), - this, - SLOT(ShowGroupsOnlyToggled()) - ); - } - - - // ROW 4 - // ~~~~~ - - // checkbox for include zones - if ((prop = this->proxy()->GetProperty("UiIncludeZones")) != 0) - { - // immediate update on the Server Manager side - prop->SetImmediateUpdate(true); - - IncludeZones_ = new QCheckBox("Include Zones"); - IncludeZones_->setChecked - ( - vtkSMIntVectorProperty::SafeDownCast(prop)->GetElement(0) - ); - IncludeZones_->setToolTip - ( - "ZoneMesh information is used to find {cell,face,point}Zones. " - "The polyMesh/ directory is only checked on startup." - ); - - // row/col 1,1 - form->addWidget(IncludeZones_, 4, 0, Qt::AlignLeft); - connect - ( - IncludeZones_, - SIGNAL(stateChanged(int)), - this, - SLOT(IncludeZonesToggled()) - ); - } - - // checkbox for patch names - if ((prop = this->proxy()->GetProperty("UiShowPatchNames")) != 0) - { - // immediate update on the Server Manager side - prop->SetImmediateUpdate(true); - - ShowPatchNames_ = new QCheckBox("Patch Names"); - ShowPatchNames_->setChecked - ( - vtkSMIntVectorProperty::SafeDownCast(prop)->GetElement(0) - ); - ShowPatchNames_->setToolTip - ( - "Show patch names in render window." - ); - - // row/col 0,1 - form->addWidget(ShowPatchNames_, 4, 1, Qt::AlignLeft); - connect - ( - ShowPatchNames_, - SIGNAL(stateChanged(int)), - this, - SLOT(ShowPatchNamesToggled()) - ); - } - - // ROW 5 - // ~~~~~ - - QFrame* hline2 = new QFrame(this); - hline2->setFrameStyle(QFrame::HLine | QFrame::Sunken); - form->addWidget(hline2, 5, 0, 1, 3); - - // ROW 6 - // ~~~~~ - - // checkbox for vol field interpolation - if ((prop = this->proxy()->GetProperty("UiInterpolateVolFields")) != 0) - { - // immediate update on the Server Manager side - prop->SetImmediateUpdate(true); - - InterpolateVolFields_ = new QCheckBox("Interpolate volFields"); - InterpolateVolFields_->setChecked - ( - vtkSMIntVectorProperty::SafeDownCast(prop)->GetElement(0) - ); - InterpolateVolFields_->setToolTip - ( - "Interpolate volFields into pointFields" - ); - - // row/col 1,1 - form->addWidget(InterpolateVolFields_, 6, 0, Qt::AlignLeft); - connect - ( - InterpolateVolFields_, - SIGNAL(stateChanged(int)), - this, - SLOT(InterpolateVolFieldsToggled()) - ); - } - - // checkbox for extrapolate patches - if ((prop = this->proxy()->GetProperty("UiExtrapolatePatches")) != 0) - { - // immediate update on the Server Manager side - prop->SetImmediateUpdate(true); - - ExtrapolatePatches_ = new QCheckBox("Extrapolate Patches"); - ExtrapolatePatches_->setChecked - ( - vtkSMIntVectorProperty::SafeDownCast(prop)->GetElement(0) - ); - ExtrapolatePatches_->setToolTip - ( - "Extrapolate internalField to non-constraint patches" - ); - - // row/col 1,1 - form->addWidget(ExtrapolatePatches_, 6, 1, Qt::AlignLeft); - connect - ( - ExtrapolatePatches_, - SIGNAL(stateChanged(int)), - this, - SLOT(ExtrapolatePatchesToggled()) - ); - } - - // ROW 7 - // ~~~~~ - - QFrame* hline3 = new QFrame(this); - hline3->setFrameStyle(QFrame::HLine | QFrame::Sunken); - form->addWidget(hline3, 7, 0, 1, 3); - - // update GUI button - if ((prop = this->proxy()->GetProperty("UpdateGUI")) != 0) - { - prop->SetImmediateUpdate(1); - QPushButton* updateGUI = new QPushButton("Update GUI"); - updateGUI->setToolTip("Update GUI"); - - form->addWidget(updateGUI, 8, 0, Qt::AlignLeft); - QObject::connect - ( - updateGUI, - SIGNAL(clicked()), - this, - SLOT(setModified()) - ); - } -} - - -// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // - -void pqPVFoamReaderPanel::CacheMeshToggled() -{ - vtkSMIntVectorProperty::SafeDownCast - ( - this->proxy()->GetProperty("UiCacheMesh") - )->SetElement(0, CacheMesh_->isChecked()); -} - - -void pqPVFoamReaderPanel::RefreshPressed() -{ - // update everything - vtkSMIntVectorProperty::SafeDownCast - ( - this->proxy()->GetProperty("UiRefresh") - )->Modified(); - - vtkSMSourceProxy::SafeDownCast(this->proxy())->UpdatePipeline(); - - // render all views - pqApplicationCore::instance()->render(); -} - - -void pqPVFoamReaderPanel::ZeroTimeToggled() -{ - vtkSMIntVectorProperty::SafeDownCast - ( - this->proxy()->GetProperty("UiZeroTime") - )->SetElement(0, ZeroTime_->isChecked()); - - this->setModified(); -} - - -void pqPVFoamReaderPanel::ShowPatchNamesToggled() -{ - vtkSMIntVectorProperty::SafeDownCast - ( - this->proxy()->GetProperty("UiShowPatchNames") - )->SetElement(0, ShowPatchNames_->isChecked()); - - // update the active view - if (this->view()) - { - this->view()->render(); - } - // OR: update all views - // pqApplicationCore::instance()->render(); -} - - -void pqPVFoamReaderPanel::ShowGroupsOnlyToggled() -{ - vtkSMProperty* prop; - - vtkSMIntVectorProperty::SafeDownCast - ( - this->proxy()->GetProperty("UiShowGroupsOnly") - )->SetElement(0, ShowGroupsOnly_->isChecked()); - - if ((prop = this->proxy()->GetProperty("PartArrayStatus")) != 0) - { - this->proxy()->UpdatePropertyInformation(prop); - } -} - - -void pqPVFoamReaderPanel::IncludeSetsToggled() -{ - vtkSMProperty* prop; - - vtkSMIntVectorProperty::SafeDownCast - ( - this->proxy()->GetProperty("UiIncludeSets") - )->SetElement(0, IncludeSets_->isChecked()); - - if ((prop = this->proxy()->GetProperty("PartArrayStatus")) != 0) - { - this->proxy()->UpdatePropertyInformation(prop); - } -} - - -void pqPVFoamReaderPanel::IncludeZonesToggled() -{ - vtkSMProperty* prop; - - vtkSMIntVectorProperty::SafeDownCast - ( - this->proxy()->GetProperty("UiIncludeZones") - )->SetElement(0, IncludeZones_->isChecked()); - - if ((prop = this->proxy()->GetProperty("PartArrayStatus")) != 0) - { - this->proxy()->UpdatePropertyInformation(prop); - } -} - - -void pqPVFoamReaderPanel::ExtrapolatePatchesToggled() -{ - vtkSMProperty* prop; - - vtkSMIntVectorProperty::SafeDownCast - ( - this->proxy()->GetProperty("UiExtrapolatePatches") - )->SetElement(0, ExtrapolatePatches_->isChecked()); - - this->setModified(); -} - - -void pqPVFoamReaderPanel::InterpolateVolFieldsToggled() -{ - vtkSMProperty* prop; - - vtkSMIntVectorProperty::SafeDownCast - ( - this->proxy()->GetProperty("UiInterpolateVolFields") - )->SetElement(0, InterpolateVolFields_->isChecked()); - - this->setModified(); -} - - -// ************************************************************************* // diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader/pqPVFoamReaderPanel.h b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader/pqPVFoamReaderPanel.h deleted file mode 100644 index 6ca0f3f7a..000000000 --- a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader/pqPVFoamReaderPanel.h +++ /dev/null @@ -1,116 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM 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 General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -Class - pqPVFoamReaderPanel - -Description - GUI modifications for the ParaView reader panel - - A custom panel for the PVFoamReader. - -SourceFiles - pqPVFoamReaderPanel.cxx - -\*---------------------------------------------------------------------------*/ -#ifndef pqPVFoamReaderPanel_h -#define pqPVFoamReaderPanel_h - - -#include "pqAutoGeneratedObjectPanel.h" - -// Forward declaration of QT classes - -class QCheckBox; -class QLineEdit; -class QTimer; -class QToolButton; - -// Forward declaration of ParaView classes -class vtkSMSourceProxy; - - -/*---------------------------------------------------------------------------*\ - Class pqPVFoamReaderPanel Declaration -\*---------------------------------------------------------------------------*/ - -class pqPVFoamReaderPanel -: - public pqAutoGeneratedObjectPanel -{ - // Private data - Q_OBJECT; - typedef pqAutoGeneratedObjectPanel Superclass; - - //- ZeroTime checkbox - QCheckBox* ZeroTime_; - - //- CacheMesh checkbox - QCheckBox* CacheMesh_; - - //- Show Patch Names checkbox - QCheckBox* ShowPatchNames_; - - //- Show Groups Only checkbox - QCheckBox* ShowGroupsOnly_; - - //- IncludeSets checkbox - QCheckBox* IncludeSets_; - - //- IncludeZones checkbox - QCheckBox* IncludeZones_; - - //- InterpolateVolFields checkbox - QCheckBox* InterpolateVolFields_; - - //- ExtrapolatePatches checkbox - QCheckBox* ExtrapolatePatches_; - - -protected slots: - - void CacheMeshToggled(); - void ZeroTimeToggled(); - void RefreshPressed(); - void ShowPatchNamesToggled(); - void ShowGroupsOnlyToggled(); - void IncludeSetsToggled(); - void IncludeZonesToggled(); - void InterpolateVolFieldsToggled(); - void ExtrapolatePatchesToggled(); - - -public: - - // Constructors - - //- Construct from components - pqPVFoamReaderPanel(pqProxy*, QWidget*); -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader/vtkPVFoamReader.cxx b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader/vtkPVFoamReader.cxx index 6b539c5a6..2906b38de 100644 --- a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader/vtkPVFoamReader.cxx +++ b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader/vtkPVFoamReader.cxx @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -42,8 +42,6 @@ License // OpenFOAM includes #include "vtkPVFoam.H" -#undef EXPERIMENTAL_TIME_CACHING - // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // vtkStandardNewMacro(vtkPVFoamReader); @@ -63,16 +61,6 @@ vtkPVFoamReader::vtkPVFoamReader() output0_ = nullptr; -#ifdef VTKPVFOAM_DUALPORT - // Add second output for the Lagrangian - this->SetNumberOfOutputPorts(2); - vtkMultiBlockDataSet *lagrangian = vtkMultiBlockDataSet::New(); - lagrangian->ReleaseData(); - - this->GetExecutive()->SetOutputData(1, lagrangian); - lagrangian->Delete(); -#endif - TimeStepRange[0] = 0; TimeStepRange[1] = 0; @@ -88,8 +76,6 @@ vtkPVFoamReader::vtkPVFoamReader() ShowGroupsOnly = 0; InterpolateVolFields = 1; - UpdateGUI = 0; - PartSelection = vtkDataArraySelection::New(); VolFieldSelection = vtkDataArraySelection::New(); PointFieldSelection = vtkDataArraySelection::New(); @@ -283,7 +269,6 @@ int vtkPVFoamReader::RequestData return 0; } - // catch previous error if (!foamData_) { vtkErrorMacro("Reader failed - perhaps no mesh?"); @@ -315,17 +300,22 @@ int vtkPVFoamReader::RequestData { vtkInformation *outInfo = outputVector->GetInformationObject(infoI); - if - ( - outInfo->Has(vtkStreamingDemandDrivenPipeline::UPDATE_TIME_STEP()) - && outInfo->Length(vtkStreamingDemandDrivenPipeline::TIME_STEPS()) > 0 - ) + if (outInfo->Has(vtkStreamingDemandDrivenPipeline::UPDATE_TIME_STEP())) { + int nTimes = + outInfo->Length(vtkStreamingDemandDrivenPipeline::TIME_STEPS()); + requestTime[nRequestTime++] = - outInfo->Get + nTimes == 1 + ? outInfo->Get ( - vtkStreamingDemandDrivenPipeline::UPDATE_TIME_STEP() - ); + vtkStreamingDemandDrivenPipeline::TIME_STEPS(), + 0 + ) + : outInfo->Get + ( + vtkStreamingDemandDrivenPipeline::UPDATE_TIME_STEP() + ); } } @@ -348,68 +338,10 @@ int vtkPVFoamReader::RequestData << output->GetNumberOfBlocks() << " blocks\n"; } - -#ifdef EXPERIMENTAL_TIME_CACHING - bool needsUpdate = false; - - if (!output0_) - { - output0_ = vtkMultiBlockDataSet::New(); - needsUpdate = true; - } - - // This experimental bit of code seems to work for the geometry, - // but trashes the fields and still triggers the GeometryFilter - if (needsUpdate) - { - foamData_->Update(output); - output0_->ShallowCopy(output); - } - else - { - output->ShallowCopy(output0_); - } - - if (Foam::vtkPVFoam::debug) - { - if (needsUpdate) - { - cout<< "full UPDATE ---------\n"; - } - else - { - cout<< "cached UPDATE ---------\n"; - } - - cout<< "UPDATED output: "; - output->Print(cout); - - cout<< "UPDATED output0_: "; - output0_->Print(cout); - } - -#else - -#ifdef VTKPVFOAM_DUALPORT - foamData_->Update - ( - output, - vtkMultiBlockDataSet::SafeDownCast - ( - outputVector->GetInformationObject(1)->Get - ( - vtkMultiBlockDataSet::DATA_OBJECT() - ) - ); - ); -#else foamData_->Update(output, output); -#endif updatePatchNamesView(ShowPatchNames); -#endif - // Do any cleanup on the OpenFOAM side foamData_->CleanUp(); @@ -417,7 +349,7 @@ int vtkPVFoamReader::RequestData } -void vtkPVFoamReader::SetRefresh(int val) +void vtkPVFoamReader::SetRefresh() { Modified(); } diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader/vtkPVFoamReader.h b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader/vtkPVFoamReader.h index d29b80e1f..d14e8f2c5 100644 --- a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader/vtkPVFoamReader.h +++ b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader/vtkPVFoamReader.h @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -84,18 +84,13 @@ public: // Description: // OpenFOAM refresh times/fields - virtual void SetRefresh(int); + virtual void SetRefresh(); // Description: // OpenFOAM skip/include the 0/ time directory vtkSetMacro(SkipZeroTime, int); vtkGetMacro(SkipZeroTime, int); - // Description: - // GUI update control - vtkSetMacro(UpdateGUI, int); - vtkGetMacro(UpdateGUI, int); - // Description: // OpenFOAM extrapolate internal values onto the patches vtkSetMacro(ExtrapolatePatches, int); @@ -239,9 +234,6 @@ private: int ShowGroupsOnly; int InterpolateVolFields; - //- Dummy variable/switch to invoke a reader update - int UpdateGUI; - vtkDataArraySelection* PartSelection; vtkDataArraySelection* VolFieldSelection; vtkDataArraySelection* PointFieldSelection; diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoam.C b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoam.C index ba4436bbc..d35125155 100644 --- a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoam.C +++ b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoam.C @@ -152,11 +152,6 @@ int Foam::vtkPVFoam::setTime(int nRequest, const double requestTimes[]) { meshChanged_ = true; } - - reader_->UpdateProgress(0.05); - - // this seems to be needed for catching Lagrangian fields - updateInfo(); } if (debug) @@ -525,10 +520,6 @@ void Foam::vtkPVFoam::Update reader_->UpdateProgress(0.7); } -#ifdef VTKPVFOAM_DUALPORT - // restart port1 at block=0 - blockNo = 0; -#endif convertMeshLagrangian(lagrangianOutput, blockNo); reader_->UpdateProgress(0.8); diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoam.H b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoam.H index 9c154e46e..c03e8f25d 100644 --- a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoam.H +++ b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoam.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -69,8 +69,6 @@ SourceFiles #include "PrimitivePatchInterpolation.H" #include "volPointInterpolation.H" -#undef VTKPVFOAM_DUALPORT - // * * * * * * * * * * * * * Forward Declarations * * * * * * * * * * * * * // class vtkDataArraySelection; diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoamUpdateInfo.C b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoamUpdateInfo.C index 502edc256..d876795eb 100644 --- a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoamUpdateInfo.C +++ b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoamUpdateInfo.C @@ -188,26 +188,30 @@ void Foam::vtkPVFoam::updateInfoLagrangian lagrangianPrefix = meshRegion_/cloud::prefix; } - // Search for list of lagrangian objects for this time - fileNameList cloudDirs - ( - readDir(dbPtr_->timePath()/lagrangianPrefix, fileName::DIRECTORY) - ); - arrayRangeLagrangian_.reset(arraySelection->GetNumberOfArrays()); - int nClouds = 0; - forAll(cloudDirs, cloudI) + // Generate a list of lagrangian clouds across all times + HashSet cloudDirs; + instantList times = dbPtr_().times(); + forAll(times, timei) + { + cloudDirs += + readDir + ( + dbPtr_->path()/times[timei].name()/lagrangianPrefix, + fileName::DIRECTORY + ); + } + + forAllConstIter(HashSet, cloudDirs, cloudIter) { - // Add cloud to GUI list arraySelection->AddArray ( - (cloudDirs[cloudI] + " - lagrangian").c_str() + (cloudIter.key() + " - lagrangian").c_str() ); - - ++nClouds; } - arrayRangeLagrangian_ += nClouds; + + arrayRangeLagrangian_ += cloudDirs.size(); if (debug) { @@ -650,19 +654,6 @@ void Foam::vtkPVFoam::updateInfoLagrangianFields() stringList enabledEntries = getSelectedArrayEntries(fieldSelection); fieldSelection->RemoveAllArrays(); - // TODO - currently only get fields from ONE cloud - // have to decide if the second set of fields get mixed in - // or dealt with separately - - const arrayRange& range = arrayRangeLagrangian_; - if (range.empty()) - { - return; - } - - int partId = range.start(); - word cloudName = getPartName(partId); - // use the db directly since this might be called without a mesh, // but the region must get added back in fileName lagrangianPrefix(cloud::prefix); @@ -671,52 +662,38 @@ void Foam::vtkPVFoam::updateInfoLagrangianFields() lagrangianPrefix = meshRegion_/cloud::prefix; } - IOobjectList objects - ( - dbPtr_(), - dbPtr_().timeName(), - lagrangianPrefix/cloudName - ); + // Add the available fields from all clouds and all time directories. + // Differing sets of fields from multiple clouds get combined into a single + // set. ParaView will display "(partial)" after field names that only apply + // to some of the clouds. + const arrayRange& range = arrayRangeLagrangian_; + for (label partId = range.start(); partId < range.end(); ++ partId) + { + const instantList times = dbPtr_().times(); + forAll(times, timei) + { + IOobjectList objects + ( + dbPtr_(), + times[timei].name(), + lagrangianPrefix/getPartName(partId) + ); - addToSelection> - ( - fieldSelection, - objects - ); - addToSelection> - ( - fieldSelection, - objects - ); - addToSelection> - ( - fieldSelection, - objects - ); - addToSelection> - ( - fieldSelection, - - objects - ); - addToSelection> - ( - fieldSelection, - objects - ); - addToSelection> - ( - fieldSelection, - objects - ); + addToSelection>(fieldSelection, objects); + addToSelection>(fieldSelection, objects); + addToSelection>(fieldSelection, objects); + addToSelection>(fieldSelection, objects); + addToSelection>(fieldSelection, objects); + addToSelection>(fieldSelection, objects); + } + } // restore the enabled selections setSelectedArrayEntries(fieldSelection, enabledEntries); if (debug) { - Info<< " Foam::vtkPVFoam::updateInfoLagrangianFields - " - << "lagrangian objects.size() = " << objects.size() << endl; + Info<< " Foam::vtkPVFoam::updateInfoLagrangianFields" << endl; } } diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoamUpdateInfoFields.H b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoamUpdateInfoFields.H index 3a29ca5da..5849b4e89 100644 --- a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoamUpdateInfoFields.H +++ b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoamUpdateInfoFields.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -69,35 +69,39 @@ void Foam::vtkPVFoam::updateInfoFields regionPrefix = meshRegion_; } - // Search for list of objects for this time and mesh region - IOobjectList objects(dbPtr_(), dbPtr_().timeName(), regionPrefix); + instantList times = dbPtr_().times(); + forAll(times, timei) + { + // Search for list of objects for this time and mesh region + IOobjectList objects(dbPtr_(), times[timei].name(), regionPrefix); - //- Add volume fields to GUI - addToSelection> - ( - select, - objects - ); - addToSelection> - ( - select, - objects - ); - addToSelection> - ( - select, - objects - ); - addToSelection> - ( - select, - objects - ); - addToSelection> - ( - select, - objects - ); + //- Add volume fields to GUI + addToSelection> + ( + select, + objects + ); + addToSelection> + ( + select, + objects + ); + addToSelection> + ( + select, + objects + ); + addToSelection> + ( + select, + objects + ); + addToSelection> + ( + select, + objects + ); + } // restore the enabled selections setSelectedArrayEntries(select, enabledEntries); diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/CMakeLists.txt b/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/CMakeLists.txt index d8f436224..81e95a81b 100644 --- a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/CMakeLists.txt +++ b/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/CMakeLists.txt @@ -1,12 +1,4 @@ -# create a plugin that adds a reader to the ParaView GUI -# it is added in the file dialog when doing opens/saves. - -# The qrc file is processed by Qt's resource compiler (rcc) -# the qrc file must have a resource prefix of "/ParaViewResources" -# and ParaView will read anything contained under that prefix -# the pqReader.xml file contains xml defining readers with their -# file extensions and descriptions. - +# Set up the environment CMAKE_MINIMUM_REQUIRED(VERSION 2.6) FIND_PACKAGE(ParaView REQUIRED) @@ -30,52 +22,33 @@ ADD_DEFINITIONS( -DWM_LABEL_SIZE=$ENV{WM_LABEL_SIZE} ) -# Set output library destination to plugin directory +# Set the output library destination to the plugin directory SET( LIBRARY_OUTPUT_PATH $ENV{PV_PLUGIN_PATH} CACHE INTERNAL "Single output directory for building all libraries." ) -# -# Define combined plugin -# - -# Extend the auto-generated panel -QT4_WRAP_CPP(MOC_SRCS pqPVblockMeshReaderPanel.h) - -ADD_PARAVIEW_OBJECT_PANEL(IFACES IFACE_SRCS - CLASS_NAME pqPVblockMeshReaderPanel - XML_NAME PVblockMeshReader # name of SourceProxy in *SM.xml - XML_GROUP sources -) - +# Add the plugin. ParaView-4.0.? requires a GUI_RESOURCE_FILES XML file. As of +# version 4.1.? this is no longer needed. IF("${PARAVIEW_VERSION_MAJOR}.${PARAVIEW_VERSION_MINOR}" EQUAL 4.0) - - # Special build options, specifically for ParaView 4.0.* - # Because as of 4.1.0, GUI_RESOURCE_FILES is no longer used. ADD_PARAVIEW_PLUGIN( - PVblockMeshReader_SM "1.0" + PVblockMeshReader_SM + "1.0" SERVER_MANAGER_XML PVblockMeshReader_SM.xml SERVER_MANAGER_SOURCES vtkPVblockMeshReader.cxx - GUI_INTERFACES ${IFACES} - GUI_SOURCES pqPVblockMeshReaderPanel.cxx - ${MOC_SRCS} ${UI_SRCS} ${IFACE_SRCS} GUI_RESOURCE_FILES PVblockMeshReader.xml - ) -ELSE("${PARAVIEW_VERSION_MAJOR}.${PARAVIEW_VERSION_MINOR}" EQUAL 4.0) + ) +ELSE() ADD_PARAVIEW_PLUGIN( - PVblockMeshReader_SM "1.0" + PVblockMeshReader_SM + "1.0" SERVER_MANAGER_XML PVblockMeshReader_SM.xml SERVER_MANAGER_SOURCES vtkPVblockMeshReader.cxx - GUI_INTERFACES ${IFACES} - GUI_SOURCES pqPVblockMeshReaderPanel.cxx - ${MOC_SRCS} ${UI_SRCS} ${IFACE_SRCS} ) -ENDIF("${PARAVIEW_VERSION_MAJOR}.${PARAVIEW_VERSION_MINOR}" EQUAL 4.0) +ENDIF() # Build the client-side plugin - TARGET_LINK_LIBRARIES( PVblockMeshReader_SM LINK_PUBLIC @@ -83,5 +56,3 @@ TARGET_LINK_LIBRARIES( blockMesh OpenFOAM ) - -#----------------------------------------------------------------------------- diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/PVblockMeshReader.qrc b/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/PVblockMeshReader.qrc deleted file mode 100644 index 228226bd5..000000000 --- a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/PVblockMeshReader.qrc +++ /dev/null @@ -1,5 +0,0 @@ - - - PVblockMeshReader.xml - - diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/PVblockMeshReader_SM.xml b/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/PVblockMeshReader_SM.xml index 28df8ae78..0383ae453 100644 --- a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/PVblockMeshReader_SM.xml +++ b/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/PVblockMeshReader_SM.xml @@ -1,114 +1,109 @@ - - + + - - - - - Specifies the filename for the OpenFOAM blockMesh Reader. - - + + + + + The file name + + - - - - - Show point numbers in render window. - - + + + + Rescan for updated blockMeshDict. + + - - - - - Rescan for updated blockMeshDict. - - + + + + + Show point numbers in the visualisation + + + + + + + + + + + + + + Select the blocks to load + + - + + + + + + + + + + + + Select the curved edges to load + + - - - - - - - - - - - - This property contains a list of the blocks - - + + + + + + - - - - - - - - - - - - This property contains a list of the curved edges - - + + + - - - - - - - - - + + diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/pqPVblockMeshReaderPanel.cxx b/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/pqPVblockMeshReaderPanel.cxx deleted file mode 100644 index 06f0db328..000000000 --- a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/pqPVblockMeshReaderPanel.cxx +++ /dev/null @@ -1,143 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM 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 General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -\*---------------------------------------------------------------------------*/ - -#include "pqPVblockMeshReaderPanel.h" - -// QT -#include -#include -#include -#include -#include -#include -#include - -// Paraview <-> QT UI -#include "pqAnimationScene.h" -#include "pqApplicationCore.h" -#include "pqPipelineRepresentation.h" -#include "pqServerManagerModel.h" -#include "pqView.h" - -// Paraview Server Manager -#include "vtkSMDoubleVectorProperty.h" -#include "vtkSMIntVectorProperty.h" -#include "vtkSMProperty.h" -#include "vtkSMSourceProxy.h" - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -pqPVblockMeshReaderPanel::pqPVblockMeshReaderPanel -( - pqProxy *proxy, - QWidget *p -) -: - pqAutoGeneratedObjectPanel(proxy, p) -{ - // Create first sublayout (at top of the panel) - QGridLayout *form = new QGridLayout(); - this->PanelLayout->addLayout(form, 0, 0, 1, -1); - - vtkSMProperty* prop = 0; - - // Refresh button for updating blocks - if ((prop = this->proxy()->GetProperty("UiRefresh")) != 0) - { - prop->SetImmediateUpdate(1); - QPushButton* refresh = new QPushButton("Refresh"); - refresh->setToolTip("Rescan for updated blockMeshDict."); - - form->addWidget(refresh, 0, 0, Qt::AlignLeft); - QObject::connect - ( - refresh, - SIGNAL(clicked()), - this, - SLOT(RefreshPressed()) - ); - } - - // Checkbox for showing point numbers - if ((prop = this->proxy()->GetProperty("UiShowPointNumbers")) != 0) - { - prop->SetImmediateUpdate(true); - - ShowPointNumbers_ = new QCheckBox("Show Point Numbers"); - ShowPointNumbers_->setToolTip("Show point numbers in render window."); - ShowPointNumbers_->setChecked - ( - vtkSMIntVectorProperty::SafeDownCast(prop)->GetElement(0) - ); - - form->addWidget(ShowPointNumbers_); - - connect - ( - ShowPointNumbers_, - SIGNAL(stateChanged(int)), - this, - SLOT(ShowPointNumbersToggled()) - ); - } - -} - -// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // - -void pqPVblockMeshReaderPanel::ShowPointNumbersToggled() -{ - vtkSMIntVectorProperty::SafeDownCast - ( - this->proxy()->GetProperty("UiShowPointNumbers") - )->SetElement(0, ShowPointNumbers_->isChecked()); - - // Update the active view - if (this->view()) - { - this->view()->render(); - } - // OR: update all views - // pqApplicationCore::instance()->render(); -} - - -void pqPVblockMeshReaderPanel::RefreshPressed() -{ - // Update everything - vtkSMIntVectorProperty::SafeDownCast - ( - this->proxy()->GetProperty("UiRefresh") - )->Modified(); - - vtkSMSourceProxy::SafeDownCast(this->proxy())->UpdatePipeline(); - - // Render all views - pqApplicationCore::instance()->render(); -} - - -// ************************************************************************* // diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/pqPVblockMeshReaderPanel.h b/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/pqPVblockMeshReaderPanel.h deleted file mode 100644 index 4c15bc374..000000000 --- a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/pqPVblockMeshReaderPanel.h +++ /dev/null @@ -1,86 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM 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 General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -Class - pqPVblockMeshReaderPanel - -Description - GUI modifications for the ParaView reader panel - - A custom panel for the PVblockMeshReader. - -SourceFiles - pqPVblockMeshReaderPanel.cxx - -\*---------------------------------------------------------------------------*/ -#ifndef pqPVblockMeshReaderPanel_h -#define pqPVblockMeshReaderPanel_h - -#include "pqAutoGeneratedObjectPanel.h" - -// Forward declaration of QT classes - -class QCheckBox; -class QLineEdit; -class QTimer; -class QToolButton; - -// Forward declaration of ParaView classes -class vtkSMSourceProxy; - - -/*---------------------------------------------------------------------------*\ - Class pqPVblockMeshReaderPanel Declaration -\*---------------------------------------------------------------------------*/ - -class pqPVblockMeshReaderPanel -: - public pqAutoGeneratedObjectPanel -{ - // Private data - Q_OBJECT; - typedef pqAutoGeneratedObjectPanel Superclass; - - //- Show Point Numbers checkbox - QCheckBox* ShowPointNumbers_; - -protected slots: - - void ShowPointNumbersToggled(); - void RefreshPressed(); - - -public: - - // Constructors - - //- Construct from components - pqPVblockMeshReaderPanel(pqProxy*, QWidget*); -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/vtkPVblockMeshReader.cxx b/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/vtkPVblockMeshReader.cxx index 6d559e7a3..364beea29 100644 --- a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/vtkPVblockMeshReader.cxx +++ b/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/vtkPVblockMeshReader.cxx @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -218,7 +218,7 @@ int vtkPVblockMeshReader::RequestData } -void vtkPVblockMeshReader::SetRefresh(int val) +void vtkPVblockMeshReader::SetRefresh() { // Delete the current blockMesh to force re-read and update if (foamData_) diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/vtkPVblockMeshReader.h b/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/vtkPVblockMeshReader.h index b160b7c03..9e6934ecc 100644 --- a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/vtkPVblockMeshReader.h +++ b/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/vtkPVblockMeshReader.h @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -78,7 +78,7 @@ public: // Description: // Refresh blockMesh from changes to blockMeshDict - virtual void SetRefresh(int); + virtual void SetRefresh(); // Description: // Blocks selection list control diff --git a/etc/config.csh/paraview b/etc/config.csh/paraview index e2d0205f8..8a972f55c 100644 --- a/etc/config.csh/paraview +++ b/etc/config.csh/paraview @@ -2,7 +2,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation +# \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation # \\/ M anipulation | #------------------------------------------------------------------------------ # License @@ -58,7 +58,8 @@ end #setenv ParaView_VERSION 4.3.1 #setenv ParaView_VERSION 4.4.0 #setenv ParaView_VERSION 5.0.0 -setenv ParaView_VERSION 5.0.1 +#setenv ParaView_VERSION 5.0.1 +setenv ParaView_VERSION 5.4.0 setenv ParaView_MAJOR detect diff --git a/etc/config.sh/paraview b/etc/config.sh/paraview index 4d5c89911..18329e193 100644 --- a/etc/config.sh/paraview +++ b/etc/config.sh/paraview @@ -2,7 +2,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation +# \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation # \\/ M anipulation | #------------------------------------------------------------------------------ # License @@ -64,7 +64,8 @@ done #export ParaView_VERSION=4.3.1 #export ParaView_VERSION=4.4.0 #export ParaView_VERSION=5.0.0 -export ParaView_VERSION=5.0.1 +#export ParaView_VERSION=5.0.1 +export ParaView_VERSION=5.4.0 export ParaView_MAJOR=detect