mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
First useful Qt modifications to the PV3blockMeshReader, PV3FoamReader
- Show Point Numbers as is_internal="1" and hook directly into a QT-checkbox and thus bypass modifying the reader state. - Same for Cache Mesh and Show Patch Names
This commit is contained in:
@ -43,7 +43,7 @@ QT4_WRAP_CPP(MOC_SRCS pqPV3FoamReaderPanel.h)
|
||||
|
||||
ADD_PARAVIEW_OBJECT_PANEL(IFACES IFACE_SRCS
|
||||
CLASS_NAME pqPV3FoamReaderPanel
|
||||
XML_NAME PV3FoamReader # name of SourceProxy in *SM.xml
|
||||
XML_NAME PV3FoamReader # name of SourceProxy in *SM.xml
|
||||
XML_GROUP sources
|
||||
)
|
||||
|
||||
@ -52,7 +52,8 @@ ADD_PARAVIEW_PLUGIN(
|
||||
SERVER_MANAGER_XML PV3FoamReader_SM.xml
|
||||
SERVER_MANAGER_SOURCES vtkPV3FoamReader.cxx
|
||||
GUI_INTERFACES ${IFACES}
|
||||
GUI_SOURCES ${MOC_SRCS} ${UI_SRCS} ${IFACE_SRCS}
|
||||
GUI_SOURCES pqPV3FoamReaderPanel.cxx
|
||||
${MOC_SRCS} ${UI_SRCS} ${IFACE_SRCS}
|
||||
GUI_RESOURCE_FILES PV3FoamReader.xml
|
||||
)
|
||||
|
||||
|
||||
@ -16,6 +16,21 @@
|
||||
</Documentation>
|
||||
</StringVectorProperty>
|
||||
|
||||
<!-- Cache Mesh check-box -->
|
||||
<IntVectorProperty
|
||||
name="UiCacheMesh"
|
||||
command="SetCacheMesh"
|
||||
number_of_elements="1"
|
||||
is_internal="1"
|
||||
default_values="1"
|
||||
animateable="0">
|
||||
<BooleanDomain name="bool"/>
|
||||
<Documentation>
|
||||
Cache the fvMesh in memory.
|
||||
</Documentation>
|
||||
</IntVectorProperty>
|
||||
|
||||
|
||||
<!-- Send discrete time info to the animation panel -->
|
||||
<DoubleVectorProperty
|
||||
name="TimestepValues"
|
||||
@ -72,10 +87,11 @@
|
||||
|
||||
<!-- Show Patch Names check-box -->
|
||||
<IntVectorProperty
|
||||
name="ShowPatchNames"
|
||||
name="UiShowPatchNames"
|
||||
command="SetShowPatchNames"
|
||||
number_of_elements="1"
|
||||
default_values="0"
|
||||
is_internal="1"
|
||||
animateable="0">
|
||||
<BooleanDomain name="bool"/>
|
||||
<Documentation>
|
||||
@ -83,21 +99,7 @@
|
||||
</Documentation>
|
||||
</IntVectorProperty>
|
||||
|
||||
<!-- Cache Mesh check-box -->
|
||||
<IntVectorProperty
|
||||
name="CacheMesh"
|
||||
command="SetCacheMesh"
|
||||
number_of_elements="1"
|
||||
default_values="1"
|
||||
animateable="0">
|
||||
<BooleanDomain name="bool"/>
|
||||
<Documentation>
|
||||
Cache the fvMesh in memory.
|
||||
</Documentation>
|
||||
</IntVectorProperty>
|
||||
|
||||
|
||||
<!-- Update GUI check box -->
|
||||
<!-- Force GUI update check box -->
|
||||
<IntVectorProperty
|
||||
name="UpdateGUI"
|
||||
command="SetUpdateGUI"
|
||||
@ -204,6 +206,14 @@
|
||||
</RequiredProperties>
|
||||
</ArraySelectionDomain>
|
||||
</StringVectorProperty>
|
||||
|
||||
<Hints>
|
||||
<Property name="FileName" show="0"/>
|
||||
<Property name="UiCacheMesh" show="0"/>
|
||||
<Property name="UiShowPatchNames" show="0"/>
|
||||
</Hints>
|
||||
|
||||
|
||||
</SourceProxy>
|
||||
</ProxyGroup>
|
||||
</ServerManagerConfiguration>
|
||||
|
||||
@ -0,0 +1,126 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd.
|
||||
\\/ 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 2 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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "pqPV3FoamReaderPanel.h"
|
||||
|
||||
// QT
|
||||
#include <QGridLayout>
|
||||
#include <QCheckBox>
|
||||
#include <QLabel>
|
||||
#include <QLayout>
|
||||
#include <QString>
|
||||
#include <QtDebug>
|
||||
|
||||
// Paraview<->QT UI
|
||||
#include "pqAnimationScene.h"
|
||||
#include "pqApplicationCore.h"
|
||||
#include "pqPipelineRepresentation.h"
|
||||
#include "pqServerManagerModel.h"
|
||||
|
||||
// Paraview Server Manager
|
||||
#include "vtkSMDoubleVectorProperty.h"
|
||||
#include "vtkSMIntVectorProperty.h"
|
||||
#include "vtkSMProperty.h"
|
||||
#include "vtkSMSourceProxy.h"
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
pqPV3FoamReaderPanel::pqPV3FoamReaderPanel
|
||||
(
|
||||
pqProxy *proxy,
|
||||
QWidget *p
|
||||
)
|
||||
:
|
||||
pqAutoGeneratedObjectPanel(proxy, p),
|
||||
sourceProxy_(vtkSMSourceProxy::SafeDownCast(this->proxy()))
|
||||
{
|
||||
// create first sublayout (at top of the panel)
|
||||
QGridLayout *sect1 = new QGridLayout();
|
||||
this->PanelLayout->addLayout(sect1, 0, 0, 1, -1);
|
||||
|
||||
|
||||
// checkbox for caching mesh
|
||||
CacheMesh_ = new QCheckBox("Cache Mesh");
|
||||
CacheMesh_->setChecked(true);
|
||||
|
||||
// checkbox for caching mesh
|
||||
ShowPatchNames_ = new QCheckBox("Show Patch Names");
|
||||
ShowPatchNames_->setChecked(false);
|
||||
|
||||
connect
|
||||
(
|
||||
CacheMesh_,
|
||||
SIGNAL(stateChanged(int)),
|
||||
this,
|
||||
SLOT(CacheMeshToggled())
|
||||
);
|
||||
|
||||
connect
|
||||
(
|
||||
ShowPatchNames_,
|
||||
SIGNAL(stateChanged(int)),
|
||||
this,
|
||||
SLOT(ShowPatchNamesToggled())
|
||||
);
|
||||
|
||||
sect1->addWidget(CacheMesh_);
|
||||
sect1->addWidget(ShowPatchNames_);
|
||||
|
||||
|
||||
// immediate update on the Server Manager side
|
||||
vtkSMIntVectorProperty::SafeDownCast
|
||||
(
|
||||
sourceProxy_->GetProperty("UiCacheMesh")
|
||||
)->SetImmediateUpdate(true);
|
||||
vtkSMIntVectorProperty::SafeDownCast
|
||||
(
|
||||
sourceProxy_->GetProperty("UiShowPatchNames")
|
||||
)->SetImmediateUpdate(true);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
void pqPV3FoamReaderPanel::CacheMeshToggled()
|
||||
{
|
||||
vtkSMIntVectorProperty::SafeDownCast
|
||||
(
|
||||
sourceProxy_->GetProperty("UiCacheMesh")
|
||||
)->SetElement(0, CacheMesh_->isChecked());
|
||||
}
|
||||
|
||||
|
||||
void pqPV3FoamReaderPanel::ShowPatchNamesToggled()
|
||||
{
|
||||
vtkSMIntVectorProperty::SafeDownCast
|
||||
(
|
||||
sourceProxy_->GetProperty("UiShowPatchNames")
|
||||
)->SetElement(0, ShowPatchNames_->isChecked());
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,34 +1,98 @@
|
||||
#ifndef __pqPV3FoamReaderPanel_h
|
||||
#define __pqPV3FoamReaderPanel_h
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd.
|
||||
\\/ 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 2 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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
pqPV3FoamReaderPanel
|
||||
|
||||
Description
|
||||
GUI modifications for the ParaView reader panel
|
||||
|
||||
A custom panel for the PV3FoamReader.
|
||||
|
||||
SourceFiles
|
||||
pqPV3FoamReaderPanel.cxx
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
#ifndef pqPV3FoamReaderPanel_h
|
||||
#define pqPV3FoamReaderPanel_h
|
||||
|
||||
#include "pqAutoGeneratedObjectPanel.h"
|
||||
#include <QLabel>
|
||||
#include <QLayout>
|
||||
|
||||
//
|
||||
// Custom panel for PV3FoamReader source.
|
||||
//
|
||||
// Forward declaration of QT classes
|
||||
|
||||
class QCheckBox;
|
||||
class QLineEdit;
|
||||
class QTimer;
|
||||
class QToolButton;
|
||||
|
||||
// Forward declaration of ParaView classes
|
||||
class vtkSMSourceProxy;
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class pqPV3FoamReaderPanel Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class pqPV3FoamReaderPanel
|
||||
:
|
||||
public pqAutoGeneratedObjectPanel
|
||||
{
|
||||
// Private data
|
||||
Q_OBJECT;
|
||||
typedef pqAutoGeneratedObjectPanel Superclass;
|
||||
|
||||
//- Server Manager Source Proxy
|
||||
vtkSMSourceProxy* sourceProxy_;
|
||||
|
||||
//- CacheMesh checkbox
|
||||
QCheckBox* CacheMesh_;
|
||||
|
||||
//- Show Patch Names checkbox
|
||||
QCheckBox* ShowPatchNames_;
|
||||
|
||||
protected slots:
|
||||
|
||||
void CacheMeshToggled();
|
||||
void ShowPatchNamesToggled();
|
||||
|
||||
|
||||
public:
|
||||
pqPV3FoamReaderPanel(pqProxy *proxy, QWidget *p)
|
||||
:
|
||||
pqAutoGeneratedObjectPanel(proxy, p)
|
||||
{
|
||||
this->layout()->addWidget
|
||||
(
|
||||
new QLabel("Plugin for reading OpenFOAM meshes/results", this)
|
||||
);
|
||||
}
|
||||
|
||||
//virtual ~pqPV3FoamReaderPanel();
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
pqPV3FoamReaderPanel(pqProxy*, QWidget*);
|
||||
|
||||
|
||||
//- Destructor
|
||||
// virtual ~pqPV3FoamReaderPanel();
|
||||
|
||||
protected:
|
||||
};
|
||||
|
||||
#endif //__pqPV3FoamReaderPanel_h
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -1,18 +1,28 @@
|
||||
/*=========================================================================
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
Program: Visualization Toolkit
|
||||
Module: $RCSfile: vtkPV3FoamReader.cxx,v $
|
||||
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 2 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
|
||||
All rights reserved.
|
||||
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
|
||||
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.
|
||||
|
||||
This software is distributed WITHOUT ANY WARRANTY; without even
|
||||
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
PURPOSE. See the above copyright notice for more information.
|
||||
|
||||
=========================================================================*/
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
#include "vtkPV3FoamReader.h"
|
||||
|
||||
#include "pqApplicationCore.h"
|
||||
@ -33,10 +43,15 @@
|
||||
// Foam includes
|
||||
#include "vtkPV3Foam.H"
|
||||
|
||||
#undef EXPERIMENTAL_TIME_CACHING
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
vtkCxxRevisionMacro(vtkPV3FoamReader, "$Revision: 1.5$");
|
||||
vtkStandardNewMacro(vtkPV3FoamReader);
|
||||
|
||||
#undef EXPERIMENTAL_TIME_CACHING
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
vtkPV3FoamReader::vtkPV3FoamReader()
|
||||
{
|
||||
@ -109,6 +124,8 @@ vtkPV3FoamReader::vtkPV3FoamReader()
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
vtkPV3FoamReader::~vtkPV3FoamReader()
|
||||
{
|
||||
vtkDebugMacro(<<"Deconstructor");
|
||||
@ -145,6 +162,8 @@ vtkPV3FoamReader::~vtkPV3FoamReader()
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
// Do everything except set the output info
|
||||
int vtkPV3FoamReader::RequestInformation
|
||||
(
|
||||
@ -401,6 +420,17 @@ int vtkPV3FoamReader::RequestData
|
||||
}
|
||||
|
||||
|
||||
void vtkPV3FoamReader::SetShowPatchNames(const int val)
|
||||
{
|
||||
if (ShowPatchNames != val)
|
||||
{
|
||||
ShowPatchNames = val;
|
||||
updatePatchNamesView(ShowPatchNames);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void vtkPV3FoamReader::updatePatchNamesView(const bool show)
|
||||
{
|
||||
pqApplicationCore* appCore = pqApplicationCore::instance();
|
||||
@ -414,7 +444,7 @@ void vtkPV3FoamReader::updatePatchNamesView(const bool show)
|
||||
// Server manager model for querying items in the server manager
|
||||
pqServerManagerModel* smModel = appCore->getServerManagerModel();
|
||||
|
||||
if (!smModel)
|
||||
if (!smModel || !foamData_)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -430,6 +460,8 @@ void vtkPV3FoamReader::updatePatchNamesView(const bool show)
|
||||
show
|
||||
);
|
||||
}
|
||||
|
||||
// use refresh here?
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -1,25 +1,52 @@
|
||||
/*=========================================================================
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
Program: Visualization Toolkit
|
||||
Module: $RCSfile: vtkPV3FoamReader.h,v $
|
||||
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 2 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
|
||||
All rights reserved.
|
||||
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
|
||||
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.
|
||||
|
||||
This software is distributed WITHOUT ANY WARRANTY; without even
|
||||
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
PURPOSE. See the above copyright notice for more information.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
=========================================================================*/
|
||||
// .NAME vtkPV3FoamReader - reads a dataset in OpenFOAM format
|
||||
// .SECTION Description
|
||||
// vtkPV3FoamReader creates an multiblock dataset.
|
||||
// It uses the OpenFOAM infrastructure (fvMesh, etc) to
|
||||
// handle mesh and field data.
|
||||
Class
|
||||
vtkPV3FoamReader
|
||||
|
||||
#ifndef __vtkPV3FoamReader_h
|
||||
#define __vtkPV3FoamReader_h
|
||||
Description
|
||||
reads a dataset in OpenFOAM format
|
||||
|
||||
vtkPV3blockMeshReader creates an multiblock dataset.
|
||||
It uses the OpenFOAM infrastructure (fvMesh, etc) to handle mesh and
|
||||
field data.
|
||||
|
||||
SourceFiles
|
||||
vtkPV3blockMeshReader.cxx
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
#ifndef vtkPV3FoamReader_h
|
||||
#define vtkPV3FoamReader_h
|
||||
|
||||
// VTK includes
|
||||
#include "vtkMultiBlockDataSetAlgorithm.h"
|
||||
|
||||
// * * * * * * * * * * * * * Forward Declarations * * * * * * * * * * * * * //
|
||||
|
||||
// VTK forward declarations
|
||||
class vtkDataArraySelection;
|
||||
class vtkCallbackCommand;
|
||||
|
||||
// Foam forward declarations
|
||||
namespace Foam
|
||||
@ -27,13 +54,10 @@ namespace Foam
|
||||
class vtkPV3Foam;
|
||||
}
|
||||
|
||||
// VTK includes
|
||||
#include "vtkMultiBlockDataSetAlgorithm.h"
|
||||
|
||||
// VTK forward declarations
|
||||
class vtkDataArraySelection;
|
||||
class vtkCallbackCommand;
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class vtkPV3FoamReader Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class VTK_IO_EXPORT vtkPV3FoamReader
|
||||
:
|
||||
@ -54,16 +78,16 @@ public:
|
||||
vtkSetStringMacro(FileName);
|
||||
vtkGetStringMacro(FileName);
|
||||
|
||||
// Description:
|
||||
// GUI update control
|
||||
vtkSetMacro(UpdateGUI, int);
|
||||
vtkGetMacro(UpdateGUI, int);
|
||||
|
||||
// Description:
|
||||
// FOAM mesh caching control
|
||||
vtkSetMacro(CacheMesh, int);
|
||||
vtkGetMacro(CacheMesh, int);
|
||||
|
||||
// Description:
|
||||
// GUI update control
|
||||
vtkSetMacro(UpdateGUI, int);
|
||||
vtkGetMacro(UpdateGUI, int);
|
||||
|
||||
// Description:
|
||||
// FOAM extrapolate internal values onto the patches
|
||||
vtkSetMacro(ExtrapolatePatches, int);
|
||||
@ -80,7 +104,7 @@ public:
|
||||
|
||||
// Description:
|
||||
// FOAM display patch names control
|
||||
vtkSetMacro(ShowPatchNames, int);
|
||||
virtual void SetShowPatchNames(int);
|
||||
vtkGetMacro(ShowPatchNames, int);
|
||||
|
||||
// Description:
|
||||
|
||||
@ -41,16 +41,17 @@ QT4_WRAP_CPP(MOC_SRCS pqPV3blockMeshReaderPanel.h)
|
||||
|
||||
ADD_PARAVIEW_OBJECT_PANEL(IFACES IFACE_SRCS
|
||||
CLASS_NAME pqPV3blockMeshReaderPanel
|
||||
XML_NAME PV3blockMeshReader # name of SourceProxy in *SM.xml
|
||||
XML_NAME PV3blockMeshReader # name of SourceProxy in *SM.xml
|
||||
XML_GROUP sources
|
||||
)
|
||||
|
||||
ADD_PARAVIEW_PLUGIN(
|
||||
PV3blockMeshReader_SM "1.0"
|
||||
SERVER_MANAGER_XML PV3blockMeshReader_SM.xml
|
||||
SERVER_MANAGER_SOURCES vtkPV3blockMeshReader.cxx
|
||||
SERVER_MANAGER_SOURCES vtkPV3blockMeshReader.cxx
|
||||
GUI_INTERFACES ${IFACES}
|
||||
GUI_SOURCES ${MOC_SRCS} ${UI_SRCS} ${IFACE_SRCS}
|
||||
GUI_SOURCES pqPV3blockMeshReaderPanel.cxx
|
||||
${MOC_SRCS} ${UI_SRCS} ${IFACE_SRCS}
|
||||
GUI_RESOURCE_FILES PV3blockMeshReader.xml
|
||||
)
|
||||
|
||||
|
||||
@ -16,14 +16,13 @@
|
||||
</Documentation>
|
||||
</StringVectorProperty>
|
||||
|
||||
<!-- Global settings -->
|
||||
|
||||
<!-- Show Point Numbers check-box -->
|
||||
<IntVectorProperty
|
||||
name="ShowPointNumbers"
|
||||
name="UiShowPointNumbers"
|
||||
command="SetShowPointNumbers"
|
||||
number_of_elements="1"
|
||||
default_values="1"
|
||||
is_internal="1"
|
||||
animateable="0">
|
||||
<BooleanDomain name="bool"/>
|
||||
<Documentation>
|
||||
@ -44,7 +43,6 @@
|
||||
</Documentation>
|
||||
</IntVectorProperty>
|
||||
|
||||
|
||||
<!-- Selections -->
|
||||
|
||||
<!-- Available Parts (blocks) array -->
|
||||
@ -93,6 +91,11 @@
|
||||
</ArraySelectionDomain>
|
||||
</StringVectorProperty>
|
||||
|
||||
<Hints>
|
||||
<Property name="FileName" show="0"/>
|
||||
<Property name="UiShowPointNumbers" show="0"/>
|
||||
</Hints>
|
||||
|
||||
</SourceProxy>
|
||||
</ProxyGroup>
|
||||
</ServerManagerConfiguration>
|
||||
|
||||
@ -0,0 +1,100 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd.
|
||||
\\/ 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 2 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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "pqPV3blockMeshReaderPanel.h"
|
||||
|
||||
// QT
|
||||
#include <QGridLayout>
|
||||
#include <QCheckBox>
|
||||
#include <QLabel>
|
||||
#include <QLayout>
|
||||
#include <QString>
|
||||
#include <QtDebug>
|
||||
|
||||
// Paraview<->QT UI
|
||||
#include "pqAnimationScene.h"
|
||||
#include "pqApplicationCore.h"
|
||||
#include "pqPipelineRepresentation.h"
|
||||
#include "pqServerManagerModel.h"
|
||||
|
||||
// Paraview Server Manager
|
||||
#include "vtkSMDoubleVectorProperty.h"
|
||||
#include "vtkSMIntVectorProperty.h"
|
||||
#include "vtkSMProperty.h"
|
||||
#include "vtkSMSourceProxy.h"
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
pqPV3blockMeshReaderPanel::pqPV3blockMeshReaderPanel
|
||||
(
|
||||
pqProxy *proxy,
|
||||
QWidget *p
|
||||
)
|
||||
:
|
||||
pqAutoGeneratedObjectPanel(proxy, p),
|
||||
sourceProxy_(vtkSMSourceProxy::SafeDownCast(this->proxy()))
|
||||
{
|
||||
// create first sublayout (at top of the panel)
|
||||
QGridLayout *sect1 = new QGridLayout();
|
||||
this->PanelLayout->addLayout(sect1, 0, 0, 1, -1);
|
||||
|
||||
|
||||
// checkbox for showing point numbers
|
||||
ShowPointNumbers_ = new QCheckBox("Show Point Numbers");
|
||||
ShowPointNumbers_->setChecked(true);
|
||||
|
||||
connect
|
||||
(
|
||||
ShowPointNumbers_,
|
||||
SIGNAL(stateChanged(int)),
|
||||
this,
|
||||
SLOT(ShowPointNumbersToggled())
|
||||
);
|
||||
|
||||
sect1->addWidget(ShowPointNumbers_);
|
||||
|
||||
|
||||
// immediate update on the Server Manager side
|
||||
vtkSMIntVectorProperty::SafeDownCast
|
||||
(
|
||||
sourceProxy_->GetProperty("UiShowPointNumbers")
|
||||
)->SetImmediateUpdate(true);
|
||||
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
void pqPV3blockMeshReaderPanel::ShowPointNumbersToggled()
|
||||
{
|
||||
vtkSMIntVectorProperty::SafeDownCast
|
||||
(
|
||||
sourceProxy_->GetProperty("UiShowPointNumbers")
|
||||
)->SetElement(0, ShowPointNumbers_->isChecked());
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,34 +1,94 @@
|
||||
#ifndef __pqPV3blockMeshReaderPanel_h
|
||||
#define __pqPV3blockMeshReaderPanel_h
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd.
|
||||
\\/ 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 2 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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
pqPV3blockMeshReaderPanel
|
||||
|
||||
Description
|
||||
GUI modifications for the ParaView reader panel
|
||||
|
||||
A custom panel for the PV3blockMeshReader.
|
||||
|
||||
SourceFiles
|
||||
pqPV3blockMeshReaderPanel.cxx
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
#ifndef pqPV3blockMeshReaderPanel_h
|
||||
#define pqPV3blockMeshReaderPanel_h
|
||||
|
||||
#include "pqAutoGeneratedObjectPanel.h"
|
||||
#include <QLabel>
|
||||
#include <QLayout>
|
||||
|
||||
//
|
||||
// Custom panel for PV3blockMeshReader source.
|
||||
//
|
||||
// Forward declaration of QT classes
|
||||
|
||||
class QCheckBox;
|
||||
class QLineEdit;
|
||||
class QTimer;
|
||||
class QToolButton;
|
||||
|
||||
// Forward declaration of ParaView classes
|
||||
class vtkSMSourceProxy;
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class pqPV3blockMeshReaderPanel Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class pqPV3blockMeshReaderPanel
|
||||
:
|
||||
public pqAutoGeneratedObjectPanel
|
||||
{
|
||||
// Private data
|
||||
Q_OBJECT;
|
||||
typedef pqAutoGeneratedObjectPanel Superclass;
|
||||
|
||||
//- Server Manager Source Proxy
|
||||
vtkSMSourceProxy* sourceProxy_;
|
||||
|
||||
//- Show Point Numbers checkbox
|
||||
QCheckBox* ShowPointNumbers_;
|
||||
|
||||
protected slots:
|
||||
|
||||
void ShowPointNumbersToggled();
|
||||
|
||||
|
||||
public:
|
||||
pqPV3blockMeshReaderPanel(pqProxy *proxy, QWidget *p)
|
||||
:
|
||||
pqAutoGeneratedObjectPanel(proxy, p)
|
||||
{
|
||||
this->layout()->addWidget
|
||||
(
|
||||
new QLabel("Plugin for reading OpenFOAM blockMesh files", this)
|
||||
);
|
||||
}
|
||||
|
||||
//virtual ~pqPV3blockMeshReaderPanel();
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
pqPV3blockMeshReaderPanel(pqProxy*, QWidget*);
|
||||
|
||||
|
||||
//- Destructor
|
||||
// virtual ~pqPV3blockMeshReaderPanel();
|
||||
|
||||
protected:
|
||||
};
|
||||
|
||||
#endif //__pqPV3blockMeshReaderPanel_h
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -1,18 +1,28 @@
|
||||
/*=========================================================================
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
Program: Visualization Toolkit
|
||||
Module: $RCSfile: vtkPV3blockMeshReader.cxx,v $
|
||||
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 2 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
|
||||
All rights reserved.
|
||||
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
|
||||
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.
|
||||
|
||||
This software is distributed WITHOUT ANY WARRANTY; without even
|
||||
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
PURPOSE. See the above copyright notice for more information.
|
||||
|
||||
=========================================================================*/
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
#include "vtkPV3blockMeshReader.h"
|
||||
|
||||
#include "pqApplicationCore.h"
|
||||
@ -33,9 +43,14 @@
|
||||
// Foam includes
|
||||
#include "vtkPV3blockMesh.H"
|
||||
|
||||
vtkCxxRevisionMacro(vtkPV3blockMeshReader, "$Revision: 1.5$");
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
vtkCxxRevisionMacro(vtkPV3blockMeshReader, "$Revision:$");
|
||||
vtkStandardNewMacro(vtkPV3blockMeshReader);
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
vtkPV3blockMeshReader::vtkPV3blockMeshReader()
|
||||
{
|
||||
Debug = 0;
|
||||
@ -76,6 +91,8 @@ vtkPV3blockMeshReader::vtkPV3blockMeshReader()
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
vtkPV3blockMeshReader::~vtkPV3blockMeshReader()
|
||||
{
|
||||
vtkDebugMacro(<<"Deconstructor");
|
||||
@ -100,6 +117,8 @@ vtkPV3blockMeshReader::~vtkPV3blockMeshReader()
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
// Do everything except set the output info
|
||||
int vtkPV3blockMeshReader::RequestInformation
|
||||
(
|
||||
@ -216,6 +235,17 @@ int vtkPV3blockMeshReader::RequestData
|
||||
}
|
||||
|
||||
|
||||
|
||||
void vtkPV3blockMeshReader::SetShowPointNumbers(const int val)
|
||||
{
|
||||
if (ShowPointNumbers != val)
|
||||
{
|
||||
ShowPointNumbers = val;
|
||||
updatePointNumbersView(ShowPointNumbers);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void vtkPV3blockMeshReader::updatePointNumbersView(const bool show)
|
||||
{
|
||||
pqApplicationCore* appCore = pqApplicationCore::instance();
|
||||
@ -228,14 +258,14 @@ void vtkPV3blockMeshReader::updatePointNumbersView(const bool show)
|
||||
|
||||
// Server manager model for querying items in the server manager
|
||||
pqServerManagerModel* smModel = appCore->getServerManagerModel();
|
||||
if (!smModel)
|
||||
if (!smModel || !foamData_)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Get all the pqRenderView instances
|
||||
QList<pqRenderView*> renderViews = smModel->findItems<pqRenderView*>();
|
||||
|
||||
for (int viewI=0; viewI<renderViews.size(); ++viewI)
|
||||
{
|
||||
foamData_->renderPointNumbers
|
||||
@ -244,6 +274,8 @@ void vtkPV3blockMeshReader::updatePointNumbersView(const bool show)
|
||||
show
|
||||
);
|
||||
}
|
||||
|
||||
// use refresh here?
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -1,38 +1,61 @@
|
||||
/*=========================================================================
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
Program: Visualization Toolkit
|
||||
Module: $RCSfile: vtkPV3blockMeshReader.h,v $
|
||||
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 2 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
|
||||
All rights reserved.
|
||||
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
|
||||
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.
|
||||
|
||||
This software is distributed WITHOUT ANY WARRANTY; without even
|
||||
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
PURPOSE. See the above copyright notice for more information.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
=========================================================================*/
|
||||
// .NAME vtkPV3blockMeshReader - reads a dataset in OpenFOAM bockMesh format
|
||||
// .SECTION Description
|
||||
// vtkPV3blockMeshReader creates an multiblock dataset.
|
||||
// It uses the OpenFOAM infrastructure (blockMesh).
|
||||
Class
|
||||
vtkPV3blockMeshReader
|
||||
|
||||
#ifndef __vtkPV3blockMeshReader_h
|
||||
#define __vtkPV3blockMeshReader_h
|
||||
Description
|
||||
reads a dataset in OpenFOAM bockMesh format
|
||||
|
||||
// Foam forward declarations
|
||||
namespace Foam
|
||||
{
|
||||
class vtkPV3blockMesh;
|
||||
}
|
||||
vtkPV3blockMeshReader creates an multiblock dataset.
|
||||
It uses the OpenFOAM infrastructure (blockMesh).
|
||||
|
||||
SourceFiles
|
||||
vtkPV3blockMeshReader.cxx
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef vtkPV3blockMeshReader_h
|
||||
#define vtkPV3blockMeshReader_h
|
||||
|
||||
// VTK includes
|
||||
#include "vtkMultiBlockDataSetAlgorithm.h"
|
||||
|
||||
// * * * * * * * * * * * * * Forward Declarations * * * * * * * * * * * * * //
|
||||
|
||||
// VTK forward declarations
|
||||
class vtkDataArraySelection;
|
||||
class vtkCallbackCommand;
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
class vtkPV3blockMesh;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class vtkPV3blockMeshReader Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class VTK_IO_EXPORT vtkPV3blockMeshReader
|
||||
:
|
||||
@ -49,15 +72,16 @@ public:
|
||||
vtkSetStringMacro(FileName);
|
||||
vtkGetStringMacro(FileName);
|
||||
|
||||
// Description:
|
||||
// Display corner point labels
|
||||
virtual void SetShowPointNumbers(int);
|
||||
vtkGetMacro(ShowPointNumbers, int);
|
||||
|
||||
// Description:
|
||||
// GUI update control
|
||||
vtkSetMacro(UpdateGUI, int);
|
||||
vtkGetMacro(UpdateGUI, int);
|
||||
|
||||
// Description:
|
||||
// FOAM display patch names control
|
||||
vtkSetMacro(ShowPointNumbers, int);
|
||||
vtkGetMacro(ShowPointNumbers, int);
|
||||
|
||||
// Description:
|
||||
// Parts (blocks) selection list control
|
||||
@ -121,6 +145,7 @@ protected:
|
||||
|
||||
char* FileName;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
//- Disallow default bitwise copy construct
|
||||
@ -132,6 +157,8 @@ private:
|
||||
//- Add/remove point numbers to/from the view
|
||||
void updatePointNumbersView(const bool show);
|
||||
|
||||
|
||||
//- Show Point Numbers
|
||||
int ShowPointNumbers;
|
||||
|
||||
//- Dummy variable/switch to invoke a reader update
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
||||
Reference in New Issue
Block a user