mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Cleanup/fixup paraview readers
- remove patch/point text labels upon deletion - combined client/server plugin instead of separate .so files first experiment with adding panel decorations - directory reorganization
This commit is contained in:
@ -2,6 +2,9 @@
|
|||||||
cd ${0%/*} || exit 1 # run from this directory
|
cd ${0%/*} || exit 1 # run from this directory
|
||||||
set -x
|
set -x
|
||||||
|
|
||||||
|
# deal with client/server vs combined plugins
|
||||||
|
rm -f $FOAM_LIBBIN/libPV3FoamReader* 2>/dev/null
|
||||||
|
|
||||||
rm -rf PV3FoamReader/Make
|
rm -rf PV3FoamReader/Make
|
||||||
wclean libso vtkPV3Foam
|
wclean libso vtkPV3Foam
|
||||||
|
|
||||||
@ -7,7 +7,7 @@
|
|||||||
# the pqReader.xml file contains xml defining readers with their
|
# the pqReader.xml file contains xml defining readers with their
|
||||||
# file extensions and descriptions.
|
# file extensions and descriptions.
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 2.4)
|
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
|
||||||
|
|
||||||
FIND_PACKAGE(ParaView REQUIRED)
|
FIND_PACKAGE(ParaView REQUIRED)
|
||||||
INCLUDE(${PARAVIEW_USE_FILE})
|
INCLUDE(${PARAVIEW_USE_FILE})
|
||||||
@ -33,19 +33,45 @@ SET(
|
|||||||
"Single output directory for building all libraries."
|
"Single output directory for building all libraries."
|
||||||
)
|
)
|
||||||
|
|
||||||
# Build the server-side plugin
|
|
||||||
|
#
|
||||||
|
# Defined combined plugin
|
||||||
|
#
|
||||||
|
|
||||||
|
# Extend the auto-generated panel
|
||||||
|
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_GROUP sources
|
||||||
|
)
|
||||||
|
|
||||||
ADD_PARAVIEW_PLUGIN(
|
ADD_PARAVIEW_PLUGIN(
|
||||||
PV3FoamReader_SM "1.0"
|
PV3FoamReader_SM "1.0"
|
||||||
SERVER_MANAGER_XML PV3FoamReader_SM.xml
|
SERVER_MANAGER_XML PV3FoamReader_SM.xml
|
||||||
SERVER_MANAGER_SOURCES vtkPV3FoamReader.cxx
|
SERVER_MANAGER_SOURCES vtkPV3FoamReader.cxx
|
||||||
|
GUI_INTERFACES ${IFACES}
|
||||||
|
GUI_SOURCES ${MOC_SRCS} ${UI_SRCS} ${IFACE_SRCS}
|
||||||
|
GUI_RESOURCE_FILES PV3FoamReader.xml
|
||||||
)
|
)
|
||||||
|
|
||||||
# Build the client-side plugin
|
# #
|
||||||
ADD_PARAVIEW_PLUGIN(
|
# # Define the server-side portion of the reader plugin
|
||||||
PV3FoamReader
|
# #
|
||||||
"1.0"
|
# ADD_PARAVIEW_PLUGIN(
|
||||||
GUI_RESOURCES PV3FoamReader.qrc
|
# PV3FoamReader_SM "1.0"
|
||||||
)
|
# SERVER_MANAGER_XML PV3FoamReader_SM.xml
|
||||||
|
# SERVER_MANAGER_SOURCES vtkPV3FoamReader.cxx
|
||||||
|
# )
|
||||||
|
# #
|
||||||
|
# # Define the client-side portion of the reader plugin
|
||||||
|
# #
|
||||||
|
# ADD_PARAVIEW_PLUGIN(
|
||||||
|
# PV3FoamReader "1.0"
|
||||||
|
# GUI_RESOURCES PV3FoamReader.qrc
|
||||||
|
# )
|
||||||
|
#
|
||||||
|
|
||||||
TARGET_LINK_LIBRARIES(
|
TARGET_LINK_LIBRARIES(
|
||||||
PV3FoamReader_SM
|
PV3FoamReader_SM
|
||||||
@ -0,0 +1,34 @@
|
|||||||
|
#ifndef __pqPV3FoamReaderPanel_h
|
||||||
|
#define __pqPV3FoamReaderPanel_h
|
||||||
|
|
||||||
|
#include "pqAutoGeneratedObjectPanel.h"
|
||||||
|
#include <QLabel>
|
||||||
|
#include <QLayout>
|
||||||
|
|
||||||
|
//
|
||||||
|
// Custom panel for PV3FoamReader source.
|
||||||
|
//
|
||||||
|
class pqPV3FoamReaderPanel
|
||||||
|
:
|
||||||
|
public pqAutoGeneratedObjectPanel
|
||||||
|
{
|
||||||
|
Q_OBJECT;
|
||||||
|
typedef pqAutoGeneratedObjectPanel Superclass;
|
||||||
|
|
||||||
|
public:
|
||||||
|
pqPV3FoamReaderPanel(pqProxy *proxy, QWidget *p)
|
||||||
|
:
|
||||||
|
pqAutoGeneratedObjectPanel(proxy, p)
|
||||||
|
{
|
||||||
|
this->layout()->addWidget
|
||||||
|
(
|
||||||
|
new QLabel("Plugin for reading OpenFOAM meshes/results", this)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
//virtual ~pqPV3FoamReaderPanel();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif //__pqPV3FoamReaderPanel_h
|
||||||
@ -113,7 +113,12 @@ vtkPV3FoamReader::~vtkPV3FoamReader()
|
|||||||
{
|
{
|
||||||
vtkDebugMacro(<<"Deconstructor");
|
vtkDebugMacro(<<"Deconstructor");
|
||||||
|
|
||||||
delete foamData_;
|
if (foamData_)
|
||||||
|
{
|
||||||
|
// remove patch names
|
||||||
|
updatePatchNamesView(false);
|
||||||
|
delete foamData_;
|
||||||
|
}
|
||||||
|
|
||||||
if (FileName)
|
if (FileName)
|
||||||
{
|
{
|
||||||
@ -2,6 +2,9 @@
|
|||||||
cd ${0%/*} || exit 1 # run from this directory
|
cd ${0%/*} || exit 1 # run from this directory
|
||||||
set -x
|
set -x
|
||||||
|
|
||||||
|
# deal with client/server vs combined plugins
|
||||||
|
rm -f $FOAM_LIBBIN/libPV3blockMeshReader* 2>/dev/null
|
||||||
|
|
||||||
rm -rf PV3blockMeshReader/Make
|
rm -rf PV3blockMeshReader/Make
|
||||||
wclean libso vtkPV3blockMesh
|
wclean libso vtkPV3blockMesh
|
||||||
|
|
||||||
@ -7,7 +7,7 @@
|
|||||||
# the pqReader.xml file contains xml defining readers with their
|
# the pqReader.xml file contains xml defining readers with their
|
||||||
# file extensions and descriptions.
|
# file extensions and descriptions.
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 2.4)
|
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
|
||||||
|
|
||||||
FIND_PACKAGE(ParaView REQUIRED)
|
FIND_PACKAGE(ParaView REQUIRED)
|
||||||
INCLUDE(${PARAVIEW_USE_FILE})
|
INCLUDE(${PARAVIEW_USE_FILE})
|
||||||
@ -33,19 +33,45 @@ SET(
|
|||||||
"Single output directory for building all libraries."
|
"Single output directory for building all libraries."
|
||||||
)
|
)
|
||||||
|
|
||||||
# Build the server-side plugin
|
#
|
||||||
|
# Define combined plugin
|
||||||
|
#
|
||||||
|
# Try to extend the auto-generated panel
|
||||||
|
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_GROUP sources
|
||||||
|
)
|
||||||
|
|
||||||
ADD_PARAVIEW_PLUGIN(
|
ADD_PARAVIEW_PLUGIN(
|
||||||
PV3blockMeshReader_SM "1.0"
|
PV3blockMeshReader_SM "1.0"
|
||||||
SERVER_MANAGER_XML PV3blockMeshReader_SM.xml
|
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_RESOURCE_FILES PV3blockMeshReader.xml
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
# #
|
||||||
|
# # Define the server-side portion of the reader plugin
|
||||||
|
# #
|
||||||
|
# ADD_PARAVIEW_PLUGIN(PV3blockMeshReader_SM "1.0"
|
||||||
|
# SERVER_MANAGER_XML PV3blockMeshReader_SM.xml
|
||||||
|
# SERVER_MANAGER_SOURCES vtkPV3blockMeshReader.cxx
|
||||||
|
# )
|
||||||
|
# #
|
||||||
|
# # Define the client-side portion of the reader plugin
|
||||||
|
# #
|
||||||
|
# ADD_PARAVIEW_PLUGIN(
|
||||||
|
# PV3blockMeshReader "1.0"
|
||||||
|
# GUI_RESOURCES PV3blockMeshReader.qrc
|
||||||
|
# )
|
||||||
|
|
||||||
|
|
||||||
# Build the client-side plugin
|
# Build the client-side plugin
|
||||||
ADD_PARAVIEW_PLUGIN(
|
|
||||||
PV3blockMeshReader
|
|
||||||
"1.0"
|
|
||||||
GUI_RESOURCES PV3blockMeshReader.qrc
|
|
||||||
)
|
|
||||||
|
|
||||||
TARGET_LINK_LIBRARIES(
|
TARGET_LINK_LIBRARIES(
|
||||||
PV3blockMeshReader_SM
|
PV3blockMeshReader_SM
|
||||||
@ -0,0 +1,34 @@
|
|||||||
|
#ifndef __pqPV3blockMeshReaderPanel_h
|
||||||
|
#define __pqPV3blockMeshReaderPanel_h
|
||||||
|
|
||||||
|
#include "pqAutoGeneratedObjectPanel.h"
|
||||||
|
#include <QLabel>
|
||||||
|
#include <QLayout>
|
||||||
|
|
||||||
|
//
|
||||||
|
// Custom panel for PV3blockMeshReader source.
|
||||||
|
//
|
||||||
|
class pqPV3blockMeshReaderPanel
|
||||||
|
:
|
||||||
|
public pqAutoGeneratedObjectPanel
|
||||||
|
{
|
||||||
|
Q_OBJECT;
|
||||||
|
typedef pqAutoGeneratedObjectPanel Superclass;
|
||||||
|
|
||||||
|
public:
|
||||||
|
pqPV3blockMeshReaderPanel(pqProxy *proxy, QWidget *p)
|
||||||
|
:
|
||||||
|
pqAutoGeneratedObjectPanel(proxy, p)
|
||||||
|
{
|
||||||
|
this->layout()->addWidget
|
||||||
|
(
|
||||||
|
new QLabel("Plugin for reading OpenFOAM blockMesh files", this)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
//virtual ~pqPV3blockMeshReaderPanel();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif //__pqPV3blockMeshReaderPanel_h
|
||||||
@ -80,7 +80,12 @@ vtkPV3blockMeshReader::~vtkPV3blockMeshReader()
|
|||||||
{
|
{
|
||||||
vtkDebugMacro(<<"Deconstructor");
|
vtkDebugMacro(<<"Deconstructor");
|
||||||
|
|
||||||
delete foamData_;
|
if (foamData_)
|
||||||
|
{
|
||||||
|
// remove point numbers
|
||||||
|
updatePointNumbersView(false);
|
||||||
|
delete foamData_;
|
||||||
|
}
|
||||||
|
|
||||||
if (FileName)
|
if (FileName)
|
||||||
{
|
{
|
||||||
@ -219,6 +219,14 @@ Foam::vtkPV3blockMesh::~vtkPV3blockMesh()
|
|||||||
Info<< "<end> Foam::vtkPV3blockMesh::~vtkPV3blockMesh" << endl;
|
Info<< "<end> Foam::vtkPV3blockMesh::~vtkPV3blockMesh" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Hmm. pointNumberTextActors are not getting removed
|
||||||
|
//
|
||||||
|
forAll(pointNumberTextActorsPtrs_, pointI)
|
||||||
|
{
|
||||||
|
pointNumberTextActorsPtrs_[pointI]->Delete();
|
||||||
|
}
|
||||||
|
pointNumberTextActorsPtrs_.clear();
|
||||||
|
|
||||||
delete meshPtr_;
|
delete meshPtr_;
|
||||||
}
|
}
|
||||||
|
|
||||||
Reference in New Issue
Block a user