From 08fb4d5833bbc472399617dcfb8fc2d13232ccc9 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Fri, 9 Oct 2009 19:46:08 +0200 Subject: [PATCH 01/18] avoid spurious warnings on rm log.* --- tutorials/incompressible/simpleFoam/airFoil2D/Allclean | 2 +- tutorials/multiphase/settlingFoam/ras/tank3D/Allclean | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tutorials/incompressible/simpleFoam/airFoil2D/Allclean b/tutorials/incompressible/simpleFoam/airFoil2D/Allclean index f73c44df8a..35e38c65c5 100755 --- a/tutorials/incompressible/simpleFoam/airFoil2D/Allclean +++ b/tutorials/incompressible/simpleFoam/airFoil2D/Allclean @@ -3,4 +3,4 @@ # Clean time folders only rm -rf *[1-9]* -rm log.* +rm -f log.* 2>/dev/null diff --git a/tutorials/multiphase/settlingFoam/ras/tank3D/Allclean b/tutorials/multiphase/settlingFoam/ras/tank3D/Allclean index f73c44df8a..35e38c65c5 100755 --- a/tutorials/multiphase/settlingFoam/ras/tank3D/Allclean +++ b/tutorials/multiphase/settlingFoam/ras/tank3D/Allclean @@ -3,4 +3,4 @@ # Clean time folders only rm -rf *[1-9]* -rm log.* +rm -f log.* 2>/dev/null From c57262c2a0780252f78eca21cff3fa7a51263a9d Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Sun, 18 Oct 2009 16:23:41 +0200 Subject: [PATCH 02/18] 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 --- .../{ => PV2Readers}/PVFoamReader/Allwmake | 0 .../PVFoamReader/PVFoamReader/CMakeLists.txt | 0 .../PVFoamReader/Make/PVFoamReader.pvsm | 0 .../PVFoamReader/Make/PVFoamReader.xml | 0 .../PVFoamReader/PVFoamReader.pvsm.in | 0 .../PVFoamReader/PVFoamReader.xml.in | 0 .../PVFoamReader/PVFoamReaderConfigure.h.in | 0 .../PVFoamReader/PVFoamReader/vtkFoamData.cxx | 0 .../PVFoamReader/PVFoamReader/vtkFoamData.h | 0 .../PVFoamReader/vtkFoamReader.cxx | 0 .../PVFoamReader/PVFoamReader/vtkFoamReader.h | 0 .../PVFoamReader/vtkPVFoamSelectTimeSet.cxx | 0 .../PVFoamReader/vtkPVFoamSelectTimeSet.h | 0 .../vtkPVFoamServerSelectTimeSet.cxx | 0 .../vtkPVFoamServerSelectTimeSet.h | 0 .../PVFoamReader/vtkFoam/Make/files | 0 .../PVFoamReader/vtkFoam/Make/options | 0 .../vtkFoam}/vtkDataArrayTemplateImplicit.txx | 0 .../PVFoamReader/vtkFoam/vtkFoam.C | 0 .../PVFoamReader/vtkFoam/vtkFoam.H | 0 .../PVFoamReader/vtkFoam/vtkFoamAddFields.H | 0 .../vtkFoam/vtkFoamAddInternalMesh.C | 0 .../PVFoamReader/vtkFoam/vtkFoamAddPatch.C | 0 .../vtkFoam/vtkFoamConvertFields.H | 0 .../vtkFoam/vtkFoamConvertPatchFaceField.H | 0 .../vtkFoam/vtkFoamConvertPatchPointField.H | 0 .../vtkFoam/vtkFoamConvertPointField.H | 0 .../vtkFoam/vtkFoamConvertVolField.H | 0 .../vtkFoam/vtkFoamInsertNextPoint.H | 0 .../{ => PV3Readers}/PV3FoamReader/Allwclean | 3 ++ .../{ => PV3Readers}/PV3FoamReader/Allwmake | 0 .../PV3FoamReader/CMakeLists.txt | 42 +++++++++++++++---- .../PV3FoamReader/PV3FoamReader.qrc | 0 .../PV3FoamReader/PV3FoamReader.xml | 0 .../PV3FoamReader/PV3FoamReader_SM.xml | 0 .../PV3FoamReader/pqPV3FoamReaderPanel.h | 34 +++++++++++++++ .../PV3FoamReader/vtkPV3FoamReader.cxx | 7 +++- .../PV3FoamReader/vtkPV3FoamReader.h | 0 .../PV3FoamReader/vtkPV3Foam/Make/files | 0 .../PV3FoamReader/vtkPV3Foam/Make/options | 0 .../vtkDataArrayTemplateImplicit.txx | 0 .../vtkPV3Foam/vtkOpenFOAMPoints.H | 0 .../PV3FoamReader/vtkPV3Foam/vtkPV3Foam.C | 0 .../PV3FoamReader/vtkPV3Foam/vtkPV3Foam.H | 0 .../vtkPV3Foam/vtkPV3FoamAddToSelection.H | 0 .../vtkPV3Foam/vtkPV3FoamFaceField.H | 0 .../vtkPV3Foam/vtkPV3FoamFields.C | 0 .../vtkPV3Foam/vtkPV3FoamLagrangianFields.H | 0 .../PV3FoamReader/vtkPV3Foam/vtkPV3FoamMesh.C | 0 .../vtkPV3Foam/vtkPV3FoamMeshLagrangian.C | 0 .../vtkPV3Foam/vtkPV3FoamMeshPatch.C | 0 .../vtkPV3Foam/vtkPV3FoamMeshSet.C | 0 .../vtkPV3Foam/vtkPV3FoamMeshVolume.C | 0 .../vtkPV3Foam/vtkPV3FoamMeshZone.C | 0 .../vtkPV3Foam/vtkPV3FoamPatchField.H | 0 .../vtkPV3Foam/vtkPV3FoamPointFields.H | 0 .../vtkPV3Foam/vtkPV3FoamUpdateInfo.C | 0 .../vtkPV3Foam/vtkPV3FoamUpdateInfoFields.H | 0 .../vtkPV3Foam/vtkPV3FoamUtils.C | 0 .../vtkPV3Foam/vtkPV3FoamVolFields.H | 0 .../PV3blockMeshReader/Allwclean | 3 ++ .../PV3blockMeshReader/Allwmake | 0 .../PV3blockMeshReader/CMakeLists.txt | 40 ++++++++++++++---- .../PV3blockMeshReader/PV3blockMeshReader.qrc | 0 .../PV3blockMeshReader/PV3blockMeshReader.xml | 0 .../PV3blockMeshReader_SM.xml | 0 .../pqPV3blockMeshReaderPanel.h | 34 +++++++++++++++ .../vtkPV3blockMeshReader.cxx | 7 +++- .../vtkPV3blockMeshReader.h | 0 .../vtkPV3blockMesh/Make/files | 0 .../vtkPV3blockMesh/Make/options | 0 .../vtkDataArrayTemplateImplicit.txx | 0 .../vtkPV3blockMesh/vtkOpenFOAMPoints.H | 0 .../vtkPV3blockMesh/vtkPV3blockMesh.C | 8 ++++ .../vtkPV3blockMesh/vtkPV3blockMesh.H | 0 .../vtkPV3blockMesh/vtkPV3blockMeshConvert.C | 0 .../vtkPV3blockMesh/vtkPV3blockMeshUtils.C | 0 77 files changed, 161 insertions(+), 17 deletions(-) rename applications/utilities/postProcessing/graphics/{ => PV2Readers}/PVFoamReader/Allwmake (100%) rename applications/utilities/postProcessing/graphics/{ => PV2Readers}/PVFoamReader/PVFoamReader/CMakeLists.txt (100%) rename applications/utilities/postProcessing/graphics/{ => PV2Readers}/PVFoamReader/PVFoamReader/Make/PVFoamReader.pvsm (100%) rename applications/utilities/postProcessing/graphics/{ => PV2Readers}/PVFoamReader/PVFoamReader/Make/PVFoamReader.xml (100%) rename applications/utilities/postProcessing/graphics/{ => PV2Readers}/PVFoamReader/PVFoamReader/PVFoamReader.pvsm.in (100%) rename applications/utilities/postProcessing/graphics/{ => PV2Readers}/PVFoamReader/PVFoamReader/PVFoamReader.xml.in (100%) rename applications/utilities/postProcessing/graphics/{ => PV2Readers}/PVFoamReader/PVFoamReader/PVFoamReaderConfigure.h.in (100%) rename applications/utilities/postProcessing/graphics/{ => PV2Readers}/PVFoamReader/PVFoamReader/vtkFoamData.cxx (100%) rename applications/utilities/postProcessing/graphics/{ => PV2Readers}/PVFoamReader/PVFoamReader/vtkFoamData.h (100%) rename applications/utilities/postProcessing/graphics/{ => PV2Readers}/PVFoamReader/PVFoamReader/vtkFoamReader.cxx (100%) rename applications/utilities/postProcessing/graphics/{ => PV2Readers}/PVFoamReader/PVFoamReader/vtkFoamReader.h (100%) rename applications/utilities/postProcessing/graphics/{ => PV2Readers}/PVFoamReader/PVFoamReader/vtkPVFoamSelectTimeSet.cxx (100%) rename applications/utilities/postProcessing/graphics/{ => PV2Readers}/PVFoamReader/PVFoamReader/vtkPVFoamSelectTimeSet.h (100%) rename applications/utilities/postProcessing/graphics/{ => PV2Readers}/PVFoamReader/PVFoamReader/vtkPVFoamServerSelectTimeSet.cxx (100%) rename applications/utilities/postProcessing/graphics/{ => PV2Readers}/PVFoamReader/PVFoamReader/vtkPVFoamServerSelectTimeSet.h (100%) rename applications/utilities/postProcessing/graphics/{ => PV2Readers}/PVFoamReader/vtkFoam/Make/files (100%) rename applications/utilities/postProcessing/graphics/{ => PV2Readers}/PVFoamReader/vtkFoam/Make/options (100%) rename applications/utilities/postProcessing/graphics/{PV3FoamReader/vtkPV3Foam => PV2Readers/PVFoamReader/vtkFoam}/vtkDataArrayTemplateImplicit.txx (100%) rename applications/utilities/postProcessing/graphics/{ => PV2Readers}/PVFoamReader/vtkFoam/vtkFoam.C (100%) rename applications/utilities/postProcessing/graphics/{ => PV2Readers}/PVFoamReader/vtkFoam/vtkFoam.H (100%) rename applications/utilities/postProcessing/graphics/{ => PV2Readers}/PVFoamReader/vtkFoam/vtkFoamAddFields.H (100%) rename applications/utilities/postProcessing/graphics/{ => PV2Readers}/PVFoamReader/vtkFoam/vtkFoamAddInternalMesh.C (100%) rename applications/utilities/postProcessing/graphics/{ => PV2Readers}/PVFoamReader/vtkFoam/vtkFoamAddPatch.C (100%) rename applications/utilities/postProcessing/graphics/{ => PV2Readers}/PVFoamReader/vtkFoam/vtkFoamConvertFields.H (100%) rename applications/utilities/postProcessing/graphics/{ => PV2Readers}/PVFoamReader/vtkFoam/vtkFoamConvertPatchFaceField.H (100%) rename applications/utilities/postProcessing/graphics/{ => PV2Readers}/PVFoamReader/vtkFoam/vtkFoamConvertPatchPointField.H (100%) rename applications/utilities/postProcessing/graphics/{ => PV2Readers}/PVFoamReader/vtkFoam/vtkFoamConvertPointField.H (100%) rename applications/utilities/postProcessing/graphics/{ => PV2Readers}/PVFoamReader/vtkFoam/vtkFoamConvertVolField.H (100%) rename applications/utilities/postProcessing/graphics/{ => PV2Readers}/PVFoamReader/vtkFoam/vtkFoamInsertNextPoint.H (100%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3FoamReader/Allwclean (67%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3FoamReader/Allwmake (100%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3FoamReader/PV3FoamReader/CMakeLists.txt (60%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3FoamReader/PV3FoamReader/PV3FoamReader.qrc (100%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3FoamReader/PV3FoamReader/PV3FoamReader.xml (100%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3FoamReader/PV3FoamReader/PV3FoamReader_SM.xml (100%) create mode 100644 applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/pqPV3FoamReaderPanel.h rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3FoamReader/PV3FoamReader/vtkPV3FoamReader.cxx (99%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3FoamReader/PV3FoamReader/vtkPV3FoamReader.h (100%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3FoamReader/vtkPV3Foam/Make/files (100%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3FoamReader/vtkPV3Foam/Make/options (100%) rename applications/utilities/postProcessing/graphics/{PV3blockMeshReader/vtkPV3blockMesh => PV3Readers/PV3FoamReader/vtkPV3Foam}/vtkDataArrayTemplateImplicit.txx (100%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3FoamReader/vtkPV3Foam/vtkOpenFOAMPoints.H (100%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3FoamReader/vtkPV3Foam/vtkPV3Foam.C (100%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3FoamReader/vtkPV3Foam/vtkPV3Foam.H (100%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3FoamReader/vtkPV3Foam/vtkPV3FoamAddToSelection.H (100%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3FoamReader/vtkPV3Foam/vtkPV3FoamFaceField.H (100%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3FoamReader/vtkPV3Foam/vtkPV3FoamFields.C (100%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3FoamReader/vtkPV3Foam/vtkPV3FoamLagrangianFields.H (100%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMesh.C (100%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMeshLagrangian.C (100%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMeshPatch.C (100%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMeshSet.C (100%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMeshVolume.C (100%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMeshZone.C (100%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3FoamReader/vtkPV3Foam/vtkPV3FoamPatchField.H (100%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3FoamReader/vtkPV3Foam/vtkPV3FoamPointFields.H (100%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3FoamReader/vtkPV3Foam/vtkPV3FoamUpdateInfo.C (100%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3FoamReader/vtkPV3Foam/vtkPV3FoamUpdateInfoFields.H (100%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3FoamReader/vtkPV3Foam/vtkPV3FoamUtils.C (100%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3FoamReader/vtkPV3Foam/vtkPV3FoamVolFields.H (100%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3blockMeshReader/Allwclean (67%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3blockMeshReader/Allwmake (100%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3blockMeshReader/PV3blockMeshReader/CMakeLists.txt (60%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3blockMeshReader/PV3blockMeshReader/PV3blockMeshReader.qrc (100%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3blockMeshReader/PV3blockMeshReader/PV3blockMeshReader.xml (100%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3blockMeshReader/PV3blockMeshReader/PV3blockMeshReader_SM.xml (100%) create mode 100644 applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/pqPV3blockMeshReaderPanel.h rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3blockMeshReader/PV3blockMeshReader/vtkPV3blockMeshReader.cxx (98%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3blockMeshReader/PV3blockMeshReader/vtkPV3blockMeshReader.h (100%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3blockMeshReader/vtkPV3blockMesh/Make/files (100%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3blockMeshReader/vtkPV3blockMesh/Make/options (100%) rename applications/utilities/postProcessing/graphics/{PVFoamReader/vtkFoam => PV3Readers/PV3blockMeshReader/vtkPV3blockMesh}/vtkDataArrayTemplateImplicit.txx (100%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3blockMeshReader/vtkPV3blockMesh/vtkOpenFOAMPoints.H (100%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMesh.C (98%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMesh.H (100%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMeshConvert.C (100%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMeshUtils.C (100%) diff --git a/applications/utilities/postProcessing/graphics/PVFoamReader/Allwmake b/applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/Allwmake similarity index 100% rename from applications/utilities/postProcessing/graphics/PVFoamReader/Allwmake rename to applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/Allwmake diff --git a/applications/utilities/postProcessing/graphics/PVFoamReader/PVFoamReader/CMakeLists.txt b/applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/PVFoamReader/CMakeLists.txt similarity index 100% rename from applications/utilities/postProcessing/graphics/PVFoamReader/PVFoamReader/CMakeLists.txt rename to applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/PVFoamReader/CMakeLists.txt diff --git a/applications/utilities/postProcessing/graphics/PVFoamReader/PVFoamReader/Make/PVFoamReader.pvsm b/applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/PVFoamReader/Make/PVFoamReader.pvsm similarity index 100% rename from applications/utilities/postProcessing/graphics/PVFoamReader/PVFoamReader/Make/PVFoamReader.pvsm rename to applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/PVFoamReader/Make/PVFoamReader.pvsm diff --git a/applications/utilities/postProcessing/graphics/PVFoamReader/PVFoamReader/Make/PVFoamReader.xml b/applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/PVFoamReader/Make/PVFoamReader.xml similarity index 100% rename from applications/utilities/postProcessing/graphics/PVFoamReader/PVFoamReader/Make/PVFoamReader.xml rename to applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/PVFoamReader/Make/PVFoamReader.xml diff --git a/applications/utilities/postProcessing/graphics/PVFoamReader/PVFoamReader/PVFoamReader.pvsm.in b/applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/PVFoamReader/PVFoamReader.pvsm.in similarity index 100% rename from applications/utilities/postProcessing/graphics/PVFoamReader/PVFoamReader/PVFoamReader.pvsm.in rename to applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/PVFoamReader/PVFoamReader.pvsm.in diff --git a/applications/utilities/postProcessing/graphics/PVFoamReader/PVFoamReader/PVFoamReader.xml.in b/applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/PVFoamReader/PVFoamReader.xml.in similarity index 100% rename from applications/utilities/postProcessing/graphics/PVFoamReader/PVFoamReader/PVFoamReader.xml.in rename to applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/PVFoamReader/PVFoamReader.xml.in diff --git a/applications/utilities/postProcessing/graphics/PVFoamReader/PVFoamReader/PVFoamReaderConfigure.h.in b/applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/PVFoamReader/PVFoamReaderConfigure.h.in similarity index 100% rename from applications/utilities/postProcessing/graphics/PVFoamReader/PVFoamReader/PVFoamReaderConfigure.h.in rename to applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/PVFoamReader/PVFoamReaderConfigure.h.in diff --git a/applications/utilities/postProcessing/graphics/PVFoamReader/PVFoamReader/vtkFoamData.cxx b/applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/PVFoamReader/vtkFoamData.cxx similarity index 100% rename from applications/utilities/postProcessing/graphics/PVFoamReader/PVFoamReader/vtkFoamData.cxx rename to applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/PVFoamReader/vtkFoamData.cxx diff --git a/applications/utilities/postProcessing/graphics/PVFoamReader/PVFoamReader/vtkFoamData.h b/applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/PVFoamReader/vtkFoamData.h similarity index 100% rename from applications/utilities/postProcessing/graphics/PVFoamReader/PVFoamReader/vtkFoamData.h rename to applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/PVFoamReader/vtkFoamData.h diff --git a/applications/utilities/postProcessing/graphics/PVFoamReader/PVFoamReader/vtkFoamReader.cxx b/applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/PVFoamReader/vtkFoamReader.cxx similarity index 100% rename from applications/utilities/postProcessing/graphics/PVFoamReader/PVFoamReader/vtkFoamReader.cxx rename to applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/PVFoamReader/vtkFoamReader.cxx diff --git a/applications/utilities/postProcessing/graphics/PVFoamReader/PVFoamReader/vtkFoamReader.h b/applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/PVFoamReader/vtkFoamReader.h similarity index 100% rename from applications/utilities/postProcessing/graphics/PVFoamReader/PVFoamReader/vtkFoamReader.h rename to applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/PVFoamReader/vtkFoamReader.h diff --git a/applications/utilities/postProcessing/graphics/PVFoamReader/PVFoamReader/vtkPVFoamSelectTimeSet.cxx b/applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/PVFoamReader/vtkPVFoamSelectTimeSet.cxx similarity index 100% rename from applications/utilities/postProcessing/graphics/PVFoamReader/PVFoamReader/vtkPVFoamSelectTimeSet.cxx rename to applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/PVFoamReader/vtkPVFoamSelectTimeSet.cxx diff --git a/applications/utilities/postProcessing/graphics/PVFoamReader/PVFoamReader/vtkPVFoamSelectTimeSet.h b/applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/PVFoamReader/vtkPVFoamSelectTimeSet.h similarity index 100% rename from applications/utilities/postProcessing/graphics/PVFoamReader/PVFoamReader/vtkPVFoamSelectTimeSet.h rename to applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/PVFoamReader/vtkPVFoamSelectTimeSet.h diff --git a/applications/utilities/postProcessing/graphics/PVFoamReader/PVFoamReader/vtkPVFoamServerSelectTimeSet.cxx b/applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/PVFoamReader/vtkPVFoamServerSelectTimeSet.cxx similarity index 100% rename from applications/utilities/postProcessing/graphics/PVFoamReader/PVFoamReader/vtkPVFoamServerSelectTimeSet.cxx rename to applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/PVFoamReader/vtkPVFoamServerSelectTimeSet.cxx diff --git a/applications/utilities/postProcessing/graphics/PVFoamReader/PVFoamReader/vtkPVFoamServerSelectTimeSet.h b/applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/PVFoamReader/vtkPVFoamServerSelectTimeSet.h similarity index 100% rename from applications/utilities/postProcessing/graphics/PVFoamReader/PVFoamReader/vtkPVFoamServerSelectTimeSet.h rename to applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/PVFoamReader/vtkPVFoamServerSelectTimeSet.h diff --git a/applications/utilities/postProcessing/graphics/PVFoamReader/vtkFoam/Make/files b/applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/vtkFoam/Make/files similarity index 100% rename from applications/utilities/postProcessing/graphics/PVFoamReader/vtkFoam/Make/files rename to applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/vtkFoam/Make/files diff --git a/applications/utilities/postProcessing/graphics/PVFoamReader/vtkFoam/Make/options b/applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/vtkFoam/Make/options similarity index 100% rename from applications/utilities/postProcessing/graphics/PVFoamReader/vtkFoam/Make/options rename to applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/vtkFoam/Make/options diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkDataArrayTemplateImplicit.txx b/applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/vtkFoam/vtkDataArrayTemplateImplicit.txx similarity index 100% rename from applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkDataArrayTemplateImplicit.txx rename to applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/vtkFoam/vtkDataArrayTemplateImplicit.txx diff --git a/applications/utilities/postProcessing/graphics/PVFoamReader/vtkFoam/vtkFoam.C b/applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/vtkFoam/vtkFoam.C similarity index 100% rename from applications/utilities/postProcessing/graphics/PVFoamReader/vtkFoam/vtkFoam.C rename to applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/vtkFoam/vtkFoam.C diff --git a/applications/utilities/postProcessing/graphics/PVFoamReader/vtkFoam/vtkFoam.H b/applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/vtkFoam/vtkFoam.H similarity index 100% rename from applications/utilities/postProcessing/graphics/PVFoamReader/vtkFoam/vtkFoam.H rename to applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/vtkFoam/vtkFoam.H diff --git a/applications/utilities/postProcessing/graphics/PVFoamReader/vtkFoam/vtkFoamAddFields.H b/applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/vtkFoam/vtkFoamAddFields.H similarity index 100% rename from applications/utilities/postProcessing/graphics/PVFoamReader/vtkFoam/vtkFoamAddFields.H rename to applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/vtkFoam/vtkFoamAddFields.H diff --git a/applications/utilities/postProcessing/graphics/PVFoamReader/vtkFoam/vtkFoamAddInternalMesh.C b/applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/vtkFoam/vtkFoamAddInternalMesh.C similarity index 100% rename from applications/utilities/postProcessing/graphics/PVFoamReader/vtkFoam/vtkFoamAddInternalMesh.C rename to applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/vtkFoam/vtkFoamAddInternalMesh.C diff --git a/applications/utilities/postProcessing/graphics/PVFoamReader/vtkFoam/vtkFoamAddPatch.C b/applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/vtkFoam/vtkFoamAddPatch.C similarity index 100% rename from applications/utilities/postProcessing/graphics/PVFoamReader/vtkFoam/vtkFoamAddPatch.C rename to applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/vtkFoam/vtkFoamAddPatch.C diff --git a/applications/utilities/postProcessing/graphics/PVFoamReader/vtkFoam/vtkFoamConvertFields.H b/applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/vtkFoam/vtkFoamConvertFields.H similarity index 100% rename from applications/utilities/postProcessing/graphics/PVFoamReader/vtkFoam/vtkFoamConvertFields.H rename to applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/vtkFoam/vtkFoamConvertFields.H diff --git a/applications/utilities/postProcessing/graphics/PVFoamReader/vtkFoam/vtkFoamConvertPatchFaceField.H b/applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/vtkFoam/vtkFoamConvertPatchFaceField.H similarity index 100% rename from applications/utilities/postProcessing/graphics/PVFoamReader/vtkFoam/vtkFoamConvertPatchFaceField.H rename to applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/vtkFoam/vtkFoamConvertPatchFaceField.H diff --git a/applications/utilities/postProcessing/graphics/PVFoamReader/vtkFoam/vtkFoamConvertPatchPointField.H b/applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/vtkFoam/vtkFoamConvertPatchPointField.H similarity index 100% rename from applications/utilities/postProcessing/graphics/PVFoamReader/vtkFoam/vtkFoamConvertPatchPointField.H rename to applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/vtkFoam/vtkFoamConvertPatchPointField.H diff --git a/applications/utilities/postProcessing/graphics/PVFoamReader/vtkFoam/vtkFoamConvertPointField.H b/applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/vtkFoam/vtkFoamConvertPointField.H similarity index 100% rename from applications/utilities/postProcessing/graphics/PVFoamReader/vtkFoam/vtkFoamConvertPointField.H rename to applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/vtkFoam/vtkFoamConvertPointField.H diff --git a/applications/utilities/postProcessing/graphics/PVFoamReader/vtkFoam/vtkFoamConvertVolField.H b/applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/vtkFoam/vtkFoamConvertVolField.H similarity index 100% rename from applications/utilities/postProcessing/graphics/PVFoamReader/vtkFoam/vtkFoamConvertVolField.H rename to applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/vtkFoam/vtkFoamConvertVolField.H diff --git a/applications/utilities/postProcessing/graphics/PVFoamReader/vtkFoam/vtkFoamInsertNextPoint.H b/applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/vtkFoam/vtkFoamInsertNextPoint.H similarity index 100% rename from applications/utilities/postProcessing/graphics/PVFoamReader/vtkFoam/vtkFoamInsertNextPoint.H rename to applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/vtkFoam/vtkFoamInsertNextPoint.H diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/Allwclean b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/Allwclean similarity index 67% rename from applications/utilities/postProcessing/graphics/PV3FoamReader/Allwclean rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/Allwclean index 3fdbeae44c..c5f41ab9da 100755 --- a/applications/utilities/postProcessing/graphics/PV3FoamReader/Allwclean +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/Allwclean @@ -2,6 +2,9 @@ cd ${0%/*} || exit 1 # run from this directory set -x +# deal with client/server vs combined plugins +rm -f $FOAM_LIBBIN/libPV3FoamReader* 2>/dev/null + rm -rf PV3FoamReader/Make wclean libso vtkPV3Foam diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/Allwmake b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/Allwmake similarity index 100% rename from applications/utilities/postProcessing/graphics/PV3FoamReader/Allwmake rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/Allwmake diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/PV3FoamReader/CMakeLists.txt b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/CMakeLists.txt similarity index 60% rename from applications/utilities/postProcessing/graphics/PV3FoamReader/PV3FoamReader/CMakeLists.txt rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/CMakeLists.txt index 670b78c33d..7702f58039 100644 --- a/applications/utilities/postProcessing/graphics/PV3FoamReader/PV3FoamReader/CMakeLists.txt +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/CMakeLists.txt @@ -7,7 +7,7 @@ # the pqReader.xml file contains xml defining readers with their # file extensions and descriptions. -cmake_minimum_required(VERSION 2.4) +CMAKE_MINIMUM_REQUIRED(VERSION 2.6) FIND_PACKAGE(ParaView REQUIRED) INCLUDE(${PARAVIEW_USE_FILE}) @@ -33,19 +33,45 @@ SET( "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( PV3FoamReader_SM "1.0" SERVER_MANAGER_XML PV3FoamReader_SM.xml 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( - PV3FoamReader - "1.0" - GUI_RESOURCES PV3FoamReader.qrc -) +# # +# # Define the server-side portion of the reader plugin +# # +# ADD_PARAVIEW_PLUGIN( +# 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( PV3FoamReader_SM diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/PV3FoamReader/PV3FoamReader.qrc b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/PV3FoamReader.qrc similarity index 100% rename from applications/utilities/postProcessing/graphics/PV3FoamReader/PV3FoamReader/PV3FoamReader.qrc rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/PV3FoamReader.qrc diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/PV3FoamReader/PV3FoamReader.xml b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/PV3FoamReader.xml similarity index 100% rename from applications/utilities/postProcessing/graphics/PV3FoamReader/PV3FoamReader/PV3FoamReader.xml rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/PV3FoamReader.xml diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/PV3FoamReader/PV3FoamReader_SM.xml b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/PV3FoamReader_SM.xml similarity index 100% rename from applications/utilities/postProcessing/graphics/PV3FoamReader/PV3FoamReader/PV3FoamReader_SM.xml rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/PV3FoamReader_SM.xml diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/pqPV3FoamReaderPanel.h b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/pqPV3FoamReaderPanel.h new file mode 100644 index 0000000000..3c97b52dfd --- /dev/null +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/pqPV3FoamReaderPanel.h @@ -0,0 +1,34 @@ +#ifndef __pqPV3FoamReaderPanel_h +#define __pqPV3FoamReaderPanel_h + +#include "pqAutoGeneratedObjectPanel.h" +#include +#include + +// +// 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 diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/PV3FoamReader/vtkPV3FoamReader.cxx b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/vtkPV3FoamReader.cxx similarity index 99% rename from applications/utilities/postProcessing/graphics/PV3FoamReader/PV3FoamReader/vtkPV3FoamReader.cxx rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/vtkPV3FoamReader.cxx index 55964e9540..28b9a2bc6f 100644 --- a/applications/utilities/postProcessing/graphics/PV3FoamReader/PV3FoamReader/vtkPV3FoamReader.cxx +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/vtkPV3FoamReader.cxx @@ -113,7 +113,12 @@ vtkPV3FoamReader::~vtkPV3FoamReader() { vtkDebugMacro(<<"Deconstructor"); - delete foamData_; + if (foamData_) + { + // remove patch names + updatePatchNamesView(false); + delete foamData_; + } if (FileName) { diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/PV3FoamReader/vtkPV3FoamReader.h b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/vtkPV3FoamReader.h similarity index 100% rename from applications/utilities/postProcessing/graphics/PV3FoamReader/PV3FoamReader/vtkPV3FoamReader.h rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/vtkPV3FoamReader.h diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/Make/files b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/Make/files similarity index 100% rename from applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/Make/files rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/Make/files diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/Make/options b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/Make/options similarity index 100% rename from applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/Make/options rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/Make/options diff --git a/applications/utilities/postProcessing/graphics/PV3blockMeshReader/vtkPV3blockMesh/vtkDataArrayTemplateImplicit.txx b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkDataArrayTemplateImplicit.txx similarity index 100% rename from applications/utilities/postProcessing/graphics/PV3blockMeshReader/vtkPV3blockMesh/vtkDataArrayTemplateImplicit.txx rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkDataArrayTemplateImplicit.txx diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkOpenFOAMPoints.H b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkOpenFOAMPoints.H similarity index 100% rename from applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkOpenFOAMPoints.H rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkOpenFOAMPoints.H diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3Foam.C b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3Foam.C similarity index 100% rename from applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3Foam.C rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3Foam.C diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3Foam.H b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3Foam.H similarity index 100% rename from applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3Foam.H rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3Foam.H diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamAddToSelection.H b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamAddToSelection.H similarity index 100% rename from applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamAddToSelection.H rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamAddToSelection.H diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamFaceField.H b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamFaceField.H similarity index 100% rename from applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamFaceField.H rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamFaceField.H diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamFields.C b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamFields.C similarity index 100% rename from applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamFields.C rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamFields.C diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamLagrangianFields.H b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamLagrangianFields.H similarity index 100% rename from applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamLagrangianFields.H rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamLagrangianFields.H diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMesh.C b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMesh.C similarity index 100% rename from applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMesh.C rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMesh.C diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMeshLagrangian.C b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMeshLagrangian.C similarity index 100% rename from applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMeshLagrangian.C rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMeshLagrangian.C diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMeshPatch.C b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMeshPatch.C similarity index 100% rename from applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMeshPatch.C rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMeshPatch.C diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMeshSet.C b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMeshSet.C similarity index 100% rename from applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMeshSet.C rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMeshSet.C diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMeshVolume.C b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMeshVolume.C similarity index 100% rename from applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMeshVolume.C rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMeshVolume.C diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMeshZone.C b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMeshZone.C similarity index 100% rename from applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMeshZone.C rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMeshZone.C diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamPatchField.H b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamPatchField.H similarity index 100% rename from applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamPatchField.H rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamPatchField.H diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamPointFields.H b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamPointFields.H similarity index 100% rename from applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamPointFields.H rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamPointFields.H diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamUpdateInfo.C b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamUpdateInfo.C similarity index 100% rename from applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamUpdateInfo.C rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamUpdateInfo.C diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamUpdateInfoFields.H b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamUpdateInfoFields.H similarity index 100% rename from applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamUpdateInfoFields.H rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamUpdateInfoFields.H diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamUtils.C b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamUtils.C similarity index 100% rename from applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamUtils.C rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamUtils.C diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamVolFields.H b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamVolFields.H similarity index 100% rename from applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamVolFields.H rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamVolFields.H diff --git a/applications/utilities/postProcessing/graphics/PV3blockMeshReader/Allwclean b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/Allwclean similarity index 67% rename from applications/utilities/postProcessing/graphics/PV3blockMeshReader/Allwclean rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/Allwclean index 30ee40ddae..d2c85df001 100755 --- a/applications/utilities/postProcessing/graphics/PV3blockMeshReader/Allwclean +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/Allwclean @@ -2,6 +2,9 @@ cd ${0%/*} || exit 1 # run from this directory set -x +# deal with client/server vs combined plugins +rm -f $FOAM_LIBBIN/libPV3blockMeshReader* 2>/dev/null + rm -rf PV3blockMeshReader/Make wclean libso vtkPV3blockMesh diff --git a/applications/utilities/postProcessing/graphics/PV3blockMeshReader/Allwmake b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/Allwmake similarity index 100% rename from applications/utilities/postProcessing/graphics/PV3blockMeshReader/Allwmake rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/Allwmake diff --git a/applications/utilities/postProcessing/graphics/PV3blockMeshReader/PV3blockMeshReader/CMakeLists.txt b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/CMakeLists.txt similarity index 60% rename from applications/utilities/postProcessing/graphics/PV3blockMeshReader/PV3blockMeshReader/CMakeLists.txt rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/CMakeLists.txt index fc645367f4..c5b911f615 100644 --- a/applications/utilities/postProcessing/graphics/PV3blockMeshReader/PV3blockMeshReader/CMakeLists.txt +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/CMakeLists.txt @@ -7,7 +7,7 @@ # the pqReader.xml file contains xml defining readers with their # file extensions and descriptions. -cmake_minimum_required(VERSION 2.4) +CMAKE_MINIMUM_REQUIRED(VERSION 2.6) FIND_PACKAGE(ParaView REQUIRED) INCLUDE(${PARAVIEW_USE_FILE}) @@ -33,19 +33,45 @@ SET( "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( PV3blockMeshReader_SM "1.0" SERVER_MANAGER_XML PV3blockMeshReader_SM.xml 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 -ADD_PARAVIEW_PLUGIN( - PV3blockMeshReader - "1.0" - GUI_RESOURCES PV3blockMeshReader.qrc -) TARGET_LINK_LIBRARIES( PV3blockMeshReader_SM diff --git a/applications/utilities/postProcessing/graphics/PV3blockMeshReader/PV3blockMeshReader/PV3blockMeshReader.qrc b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/PV3blockMeshReader.qrc similarity index 100% rename from applications/utilities/postProcessing/graphics/PV3blockMeshReader/PV3blockMeshReader/PV3blockMeshReader.qrc rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/PV3blockMeshReader.qrc diff --git a/applications/utilities/postProcessing/graphics/PV3blockMeshReader/PV3blockMeshReader/PV3blockMeshReader.xml b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/PV3blockMeshReader.xml similarity index 100% rename from applications/utilities/postProcessing/graphics/PV3blockMeshReader/PV3blockMeshReader/PV3blockMeshReader.xml rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/PV3blockMeshReader.xml diff --git a/applications/utilities/postProcessing/graphics/PV3blockMeshReader/PV3blockMeshReader/PV3blockMeshReader_SM.xml b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/PV3blockMeshReader_SM.xml similarity index 100% rename from applications/utilities/postProcessing/graphics/PV3blockMeshReader/PV3blockMeshReader/PV3blockMeshReader_SM.xml rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/PV3blockMeshReader_SM.xml diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/pqPV3blockMeshReaderPanel.h b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/pqPV3blockMeshReaderPanel.h new file mode 100644 index 0000000000..1f3c2ba9b2 --- /dev/null +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/pqPV3blockMeshReaderPanel.h @@ -0,0 +1,34 @@ +#ifndef __pqPV3blockMeshReaderPanel_h +#define __pqPV3blockMeshReaderPanel_h + +#include "pqAutoGeneratedObjectPanel.h" +#include +#include + +// +// 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 diff --git a/applications/utilities/postProcessing/graphics/PV3blockMeshReader/PV3blockMeshReader/vtkPV3blockMeshReader.cxx b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/vtkPV3blockMeshReader.cxx similarity index 98% rename from applications/utilities/postProcessing/graphics/PV3blockMeshReader/PV3blockMeshReader/vtkPV3blockMeshReader.cxx rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/vtkPV3blockMeshReader.cxx index 451c8b5855..155fc83f57 100644 --- a/applications/utilities/postProcessing/graphics/PV3blockMeshReader/PV3blockMeshReader/vtkPV3blockMeshReader.cxx +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/vtkPV3blockMeshReader.cxx @@ -80,7 +80,12 @@ vtkPV3blockMeshReader::~vtkPV3blockMeshReader() { vtkDebugMacro(<<"Deconstructor"); - delete foamData_; + if (foamData_) + { + // remove point numbers + updatePointNumbersView(false); + delete foamData_; + } if (FileName) { diff --git a/applications/utilities/postProcessing/graphics/PV3blockMeshReader/PV3blockMeshReader/vtkPV3blockMeshReader.h b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/vtkPV3blockMeshReader.h similarity index 100% rename from applications/utilities/postProcessing/graphics/PV3blockMeshReader/PV3blockMeshReader/vtkPV3blockMeshReader.h rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/vtkPV3blockMeshReader.h diff --git a/applications/utilities/postProcessing/graphics/PV3blockMeshReader/vtkPV3blockMesh/Make/files b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/Make/files similarity index 100% rename from applications/utilities/postProcessing/graphics/PV3blockMeshReader/vtkPV3blockMesh/Make/files rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/Make/files diff --git a/applications/utilities/postProcessing/graphics/PV3blockMeshReader/vtkPV3blockMesh/Make/options b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/Make/options similarity index 100% rename from applications/utilities/postProcessing/graphics/PV3blockMeshReader/vtkPV3blockMesh/Make/options rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/Make/options diff --git a/applications/utilities/postProcessing/graphics/PVFoamReader/vtkFoam/vtkDataArrayTemplateImplicit.txx b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkDataArrayTemplateImplicit.txx similarity index 100% rename from applications/utilities/postProcessing/graphics/PVFoamReader/vtkFoam/vtkDataArrayTemplateImplicit.txx rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkDataArrayTemplateImplicit.txx diff --git a/applications/utilities/postProcessing/graphics/PV3blockMeshReader/vtkPV3blockMesh/vtkOpenFOAMPoints.H b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkOpenFOAMPoints.H similarity index 100% rename from applications/utilities/postProcessing/graphics/PV3blockMeshReader/vtkPV3blockMesh/vtkOpenFOAMPoints.H rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkOpenFOAMPoints.H diff --git a/applications/utilities/postProcessing/graphics/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMesh.C b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMesh.C similarity index 98% rename from applications/utilities/postProcessing/graphics/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMesh.C rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMesh.C index 2dc5bc32e3..66da31d620 100644 --- a/applications/utilities/postProcessing/graphics/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMesh.C +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMesh.C @@ -219,6 +219,14 @@ Foam::vtkPV3blockMesh::~vtkPV3blockMesh() Info<< " Foam::vtkPV3blockMesh::~vtkPV3blockMesh" << endl; } + // Hmm. pointNumberTextActors are not getting removed + // + forAll(pointNumberTextActorsPtrs_, pointI) + { + pointNumberTextActorsPtrs_[pointI]->Delete(); + } + pointNumberTextActorsPtrs_.clear(); + delete meshPtr_; } diff --git a/applications/utilities/postProcessing/graphics/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMesh.H b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMesh.H similarity index 100% rename from applications/utilities/postProcessing/graphics/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMesh.H rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMesh.H diff --git a/applications/utilities/postProcessing/graphics/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMeshConvert.C b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMeshConvert.C similarity index 100% rename from applications/utilities/postProcessing/graphics/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMeshConvert.C rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMeshConvert.C diff --git a/applications/utilities/postProcessing/graphics/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMeshUtils.C b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMeshUtils.C similarity index 100% rename from applications/utilities/postProcessing/graphics/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMeshUtils.C rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMeshUtils.C From 1ef88a2aefbec4a1fb6e0f87b9774fb199830d62 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Sun, 18 Oct 2009 17:50:41 +0200 Subject: [PATCH 03/18] blockMesh reader fix, start refactoring of PV3Readers - apply scaleFactor (eg, mm->m) in PV3 reader - this looks better when overlaying with other objects - stop segfault when paraview exits without deleting readers first --- .../graphics/PV3Readers/Allwmake | 16 + .../PV3Readers/PV3FoamReader/Allwmake | 24 +- .../PV3FoamReader/vtkPV3FoamReader.cxx | 11 + .../PV3FoamReader/vtkPV3Foam/Make/options | 6 +- .../PV3Readers/PV3blockMeshReader/Allwmake | 24 +- .../vtkPV3blockMeshReader.cxx | 10 + .../vtkPV3blockMesh/Make/options | 2 + .../vtkPV3blockMesh/vtkOpenFOAMPoints.H | 15 + .../vtkPV3blockMesh/vtkPV3blockMesh.C | 7 +- .../vtkPV3blockMesh/vtkPV3blockMeshConvert.C | 20 +- .../PV3Readers/vtkPV3Readers/Make/files | 3 + .../PV3Readers/vtkPV3Readers/Make/options | 10 + .../PV3Readers/vtkPV3Readers/vtkPV3Readers.C | 330 ++++++++++++++++++ .../PV3Readers/vtkPV3Readers/vtkPV3Readers.H | 229 ++++++++++++ src/mesh/blockMesh/blockMesh/blockMesh.C | 6 + src/mesh/blockMesh/blockMesh/blockMesh.H | 6 + 16 files changed, 687 insertions(+), 32 deletions(-) create mode 100755 applications/utilities/postProcessing/graphics/PV3Readers/Allwmake create mode 100644 applications/utilities/postProcessing/graphics/PV3Readers/vtkPV3Readers/Make/files create mode 100644 applications/utilities/postProcessing/graphics/PV3Readers/vtkPV3Readers/Make/options create mode 100644 applications/utilities/postProcessing/graphics/PV3Readers/vtkPV3Readers/vtkPV3Readers.C create mode 100644 applications/utilities/postProcessing/graphics/PV3Readers/vtkPV3Readers/vtkPV3Readers.H diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/Allwmake b/applications/utilities/postProcessing/graphics/PV3Readers/Allwmake new file mode 100755 index 0000000000..94a47b132b --- /dev/null +++ b/applications/utilities/postProcessing/graphics/PV3Readers/Allwmake @@ -0,0 +1,16 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # run from this directory +set -x + +if [ -d "$ParaView_DIR" -a -r "$ParaView_DIR" ] +then + case "$ParaView_VERSION" in + 3*) + wmake libso vtkPV3Readers + PV3blockMeshReader/Allwmake + PV3FoamReader/Allwmake + ;; + esac +fi + +# ----------------------------------------------------------------- end-of-file diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/Allwmake b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/Allwmake index c7a80fc7fb..ef7b571102 100755 --- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/Allwmake +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/Allwmake @@ -4,18 +4,18 @@ set -x if [ -d "$ParaView_DIR" -a -r "$ParaView_DIR" ] then - case "$ParaView_VERSION" in - 3*) - wmake libso vtkPV3Foam - ( - cd PV3FoamReader - mkdir -p Make/$WM_OPTIONS > /dev/null 2>&1 - cd Make/$WM_OPTIONS - cmake ../.. - make - ) - ;; - esac + case "$ParaView_VERSION" in + 3*) + wmake libso vtkPV3Foam + ( + cd PV3FoamReader + mkdir -p Make/$WM_OPTIONS > /dev/null 2>&1 + cd Make/$WM_OPTIONS + cmake ../.. + make + ) + ;; + esac fi # ----------------------------------------------------------------- end-of-file diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/vtkPV3FoamReader.cxx b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/vtkPV3FoamReader.cxx index 28b9a2bc6f..0b5c65dc78 100644 --- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/vtkPV3FoamReader.cxx +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/vtkPV3FoamReader.cxx @@ -405,9 +405,20 @@ void vtkPV3FoamReader::updatePatchNamesView(const bool show) { pqApplicationCore* appCore = pqApplicationCore::instance(); + // need to check this, since our destructor calls this + if (!appCore) + { + return; + } + // Server manager model for querying items in the server manager pqServerManagerModel* smModel = appCore->getServerManagerModel(); + if (!smModel) + { + return; + } + // Get all the pqRenderView instances QList renderViews = smModel->findItems(); diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/Make/options b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/Make/options index 1e936c1d5d..d58afde30b 100644 --- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/Make/options +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/Make/options @@ -1,18 +1,20 @@ EXE_INC = \ + -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/lagrangian/basic/lnInclude \ - -I$(LIB_SRC)/meshTools/lnInclude \ -I$(ParaView_DIR)/VTK \ -I$(ParaView_INST_DIR) \ -I$(ParaView_INST_DIR)/VTK \ -I$(ParaView_INST_DIR)/VTK/Common \ -I$(ParaView_INST_DIR)/VTK/Filtering \ -I$(ParaView_INST_DIR)/VTK/Rendering \ + -I../../vtkPV3Readers/lnInclude \ -I../PV3FoamReader LIB_LIBS = \ + -lvtkPV3Readers \ + -lmeshTools \ -lfiniteVolume \ -lgenericPatchFields \ -llagrangian \ - -lmeshTools \ $(GLIBS) diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/Allwmake b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/Allwmake index 3e2c407e6e..443100d381 100755 --- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/Allwmake +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/Allwmake @@ -4,18 +4,18 @@ set -x if [ -d "$ParaView_DIR" -a -r "$ParaView_DIR" ] then - case "$ParaView_VERSION" in - 3*) - wmake libso vtkPV3blockMesh - ( - cd PV3blockMeshReader - mkdir -p Make/$WM_OPTIONS > /dev/null 2>&1 - cd Make/$WM_OPTIONS - cmake ../.. - make - ) - ;; - esac + case "$ParaView_VERSION" in + 3*) + wmake libso vtkPV3blockMesh + ( + cd PV3blockMeshReader + mkdir -p Make/$WM_OPTIONS > /dev/null 2>&1 + cd Make/$WM_OPTIONS + cmake ../.. + make + ) + ;; + esac fi # ----------------------------------------------------------------- end-of-file diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/vtkPV3blockMeshReader.cxx b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/vtkPV3blockMeshReader.cxx index 155fc83f57..383deeeccc 100644 --- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/vtkPV3blockMeshReader.cxx +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/vtkPV3blockMeshReader.cxx @@ -220,8 +220,18 @@ void vtkPV3blockMeshReader::updatePointNumbersView(const bool show) { pqApplicationCore* appCore = pqApplicationCore::instance(); + // need to check this, since our destructor calls this + if (!appCore) + { + return; + } + // Server manager model for querying items in the server manager pqServerManagerModel* smModel = appCore->getServerManagerModel(); + if (!smModel) + { + return; + } // Get all the pqRenderView instances QList renderViews = smModel->findItems(); diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/Make/options b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/Make/options index 2e5727ba77..5d19916934 100644 --- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/Make/options +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/Make/options @@ -7,9 +7,11 @@ EXE_INC = \ -I$(ParaView_INST_DIR)/VTK/Common \ -I$(ParaView_INST_DIR)/VTK/Filtering \ -I$(ParaView_INST_DIR)/VTK/Rendering \ + -I../../vtkPV3Readers/lnInclude \ -I../PV3blockMeshReader LIB_LIBS = \ + -lvtkPV3Readers \ -lmeshTools \ -lblockMesh \ $(GLIBS) diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkOpenFOAMPoints.H b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkOpenFOAMPoints.H index b6fa0c83b0..a8ce36e144 100644 --- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkOpenFOAMPoints.H +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkOpenFOAMPoints.H @@ -44,6 +44,21 @@ inline void vtkInsertNextOpenFOAMPoint points->InsertNextPoint(p.x(), p.y(), p.z()); } +inline void vtkInsertNextOpenFOAMPoint +( + vtkPoints *points, + const Foam::point& p, + const Foam::scalar scaleFactor +) +{ + points->InsertNextPoint + ( + p.x()*scaleFactor, + p.y()*scaleFactor, + p.z()*scaleFactor + ); +} + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #endif diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMesh.C b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMesh.C index 66da31d620..91424d3b57 100644 --- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMesh.C +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMesh.C @@ -384,6 +384,7 @@ void Foam::vtkPV3blockMesh::renderPointNumbers if (show && meshPtr_) { const pointField& cornerPts = meshPtr_->blockPointField(); + const scalar scaleFactor = meshPtr_->scaleFactor(); pointNumberTextActorsPtrs_.setSize(cornerPts.size()); forAll(cornerPts, pointI) @@ -407,9 +408,9 @@ void Foam::vtkPV3blockMesh::renderPointNumbers txt->GetPositionCoordinate()->SetValue ( - cornerPts[pointI].x(), - cornerPts[pointI].y(), - cornerPts[pointI].z() + cornerPts[pointI].x()*scaleFactor, + cornerPts[pointI].y()*scaleFactor, + cornerPts[pointI].z()*scaleFactor ); // Add text to each renderer diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMeshConvert.C b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMeshConvert.C index c163ba14ed..5ad588bb30 100644 --- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMeshConvert.C +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMeshConvert.C @@ -66,6 +66,7 @@ void Foam::vtkPV3blockMesh::convertMeshBlocks } int blockI = 0; + const scalar scaleFactor = blkMesh.scaleFactor(); for ( @@ -103,7 +104,8 @@ void Foam::vtkPV3blockMesh::convertMeshBlocks vtkInsertNextOpenFOAMPoint ( vtkpoints, - blockPoints[blockLabels[ptI]] + blockPoints[blockLabels[ptI]], + scaleFactor ); nodeIds[ptI] = ptI; @@ -159,6 +161,7 @@ void Foam::vtkPV3blockMesh::convertMeshEdges const curvedEdgeList& edges = blkMesh.edges(); int edgeI = 0; + const scalar scaleFactor = blkMesh.scaleFactor(); for ( @@ -212,7 +215,12 @@ void Foam::vtkPV3blockMesh::convertMeshEdges vtkIdType pointIds[edgePoints.size()]; forAll(edgePoints, ptI) { - vtkInsertNextOpenFOAMPoint(vtkpoints, edgePoints[ptI]); + vtkInsertNextOpenFOAMPoint + ( + vtkpoints, + edgePoints[ptI], + scaleFactor + ); pointIds[ptI] = ptI; } @@ -266,6 +274,7 @@ void Foam::vtkPV3blockMesh::convertMeshCorners label datasetNo = 0; // restart at dataset 0 const pointField& blockPoints = meshPtr_->blockPointField(); + const scalar& scaleFactor = meshPtr_->scaleFactor(); if (debug) { @@ -284,7 +293,12 @@ void Foam::vtkPV3blockMesh::convertMeshCorners vtkIdType pointId = 0; forAll(blockPoints, ptI) { - vtkInsertNextOpenFOAMPoint(vtkpoints, blockPoints[ptI]); + vtkInsertNextOpenFOAMPoint + ( + vtkpoints, + blockPoints[ptI], + scaleFactor + ); vtkcells->InsertNextCell(1, &pointId); pointId++; diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/vtkPV3Readers/Make/files b/applications/utilities/postProcessing/graphics/PV3Readers/vtkPV3Readers/Make/files new file mode 100644 index 0000000000..134b8de963 --- /dev/null +++ b/applications/utilities/postProcessing/graphics/PV3Readers/vtkPV3Readers/Make/files @@ -0,0 +1,3 @@ +vtkPV3Readers.C + +LIB = $(FOAM_LIBBIN)/libvtkPV3Readers diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/vtkPV3Readers/Make/options b/applications/utilities/postProcessing/graphics/PV3Readers/vtkPV3Readers/Make/options new file mode 100644 index 0000000000..876a3e334e --- /dev/null +++ b/applications/utilities/postProcessing/graphics/PV3Readers/vtkPV3Readers/Make/options @@ -0,0 +1,10 @@ +EXE_INC = \ + -I$(ParaView_DIR)/VTK \ + -I$(ParaView_INST_DIR) \ + -I$(ParaView_INST_DIR)/VTK \ + -I$(ParaView_INST_DIR)/VTK/Common \ + -I$(ParaView_INST_DIR)/VTK/Filtering \ + -I$(ParaView_INST_DIR)/VTK/Rendering + +LIB_LIBS = \ + $(GLIBS) diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/vtkPV3Readers/vtkPV3Readers.C b/applications/utilities/postProcessing/graphics/PV3Readers/vtkPV3Readers/vtkPV3Readers.C new file mode 100644 index 0000000000..ed10463f91 --- /dev/null +++ b/applications/utilities/postProcessing/graphics/PV3Readers/vtkPV3Readers/vtkPV3Readers.C @@ -0,0 +1,330 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-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 + +Description + Misc helper methods and utilities + +\*---------------------------------------------------------------------------*/ + +#include "vtkPV3Readers.H" + +// Foam includes +#include "IFstream.H" + +// VTK includes +#include "vtkDataArraySelection.h" +#include "vtkDataSet.h" +#include "vtkMultiBlockDataSet.h" +#include "vtkInformation.h" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineTypeNameAndDebug(Foam::vtkPV3Readers, 0); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + //! @cond fileScope + // Extract up to the first non-word characters + inline word getFirstWord(const char* str) + { + if (str) + { + label n = 0; + while (str[n] && word::valid(str[n])) + { + ++n; + } + return word(str, n, true); + } + else + { + return word::null; + } + + } + //! @endcond fileScope + +} // End namespace Foam + + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +void Foam::vtkPV3Readers::AddToBlock +( + vtkMultiBlockDataSet* output, + vtkDataSet* dataset, + const partInfo& selector, + const label datasetNo, + const std::string& datasetName +) +{ + const int blockNo = selector.block(); + + vtkDataObject* blockDO = output->GetBlock(blockNo); + vtkMultiBlockDataSet* block = vtkMultiBlockDataSet::SafeDownCast(blockDO); + + if (!block) + { + if (blockDO) + { + FatalErrorIn("Foam::vtkPV3Readers::AddToBlock") + << "Block already has a vtkDataSet assigned to it" + << endl; + return; + } + + block = vtkMultiBlockDataSet::New(); + output->SetBlock(blockNo, block); + block->Delete(); + } + + if (debug) + { + Info<< "block[" << blockNo << "] has " + << block->GetNumberOfBlocks() + << " datasets prior to adding set " << datasetNo + << " with name: " << datasetName << endl; + } + + block->SetBlock(datasetNo, dataset); + + // name the block when assigning dataset 0 + if (datasetNo == 0) + { + output->GetMetaData(blockNo)->Set + ( + vtkCompositeDataSet::NAME(), + selector.name() + ); + } + + if (datasetName.size()) + { + block->GetMetaData(datasetNo)->Set + ( + vtkCompositeDataSet::NAME(), + datasetName.c_str() + ); + } +} + + +vtkDataSet* Foam::vtkPV3Readers::GetDataSetFromBlock +( + vtkMultiBlockDataSet* output, + const partInfo& selector, + const label datasetNo +) +{ + const int blockNo = selector.block(); + + vtkDataObject* blockDO = output->GetBlock(blockNo); + vtkMultiBlockDataSet* block = vtkMultiBlockDataSet::SafeDownCast(blockDO); + + if (block) + { + return vtkDataSet::SafeDownCast(block->GetBlock(datasetNo)); + } + + return 0; +} + + +// ununsed at the moment +Foam::label Foam::vtkPV3Readers::GetNumberOfDataSets +( + vtkMultiBlockDataSet* output, + const partInfo& selector +) +{ + const int blockNo = selector.block(); + + vtkDataObject* blockDO = output->GetBlock(blockNo); + vtkMultiBlockDataSet* block = vtkMultiBlockDataSet::SafeDownCast(blockDO); + if (block) + { + return block->GetNumberOfBlocks(); + } + + return 0; +} + + +// Foam::word Foam::vtkPV3Readers::getPartName(int partId) +// { +// return getFirstWord(reader_->GetPartArrayName(partId)); +// } + + +Foam::wordHashSet Foam::vtkPV3Readers::getSelected +( + vtkDataArraySelection* select +) +{ + int nElem = select->GetNumberOfArrays(); + wordHashSet selections(2*nElem); + + for (int elemI=0; elemI < nElem; ++elemI) + { + if (select->GetArraySetting(elemI)) + { + selections.insert(getFirstWord(select->GetArrayName(elemI))); + } + } + + return selections; +} + + +Foam::wordHashSet Foam::vtkPV3Readers::getSelected +( + vtkDataArraySelection* select, + const partInfo& selector +) +{ + int nElem = select->GetNumberOfArrays(); + wordHashSet selections(2*nElem); + + for (int elemI = selector.start(); elemI < selector.end(); ++elemI) + { + if (select->GetArraySetting(elemI)) + { + selections.insert(getFirstWord(select->GetArrayName(elemI))); + } + } + + return selections; +} + + +Foam::stringList Foam::vtkPV3Readers::getSelectedArrayEntries +( + vtkDataArraySelection* select +) +{ + stringList selections(select->GetNumberOfArrays()); + label nElem = 0; + + forAll(selections, elemI) + { + if (select->GetArraySetting(elemI)) + { + selections[nElem++] = select->GetArrayName(elemI); + } + } + selections.setSize(nElem); + + + if (debug) + { + label nElem = select->GetNumberOfArrays(); + Info<< "available("; + for (int elemI = 0; elemI < nElem; ++elemI) + { + Info<< " \"" << select->GetArrayName(elemI) << "\""; + } + Info<< " )\nselected("; + + forAll(selections, elemI) + { + Info<< " " << selections[elemI]; + } + Info<< " )\n"; + } + + return selections; +} + + +Foam::stringList Foam::vtkPV3Readers::getSelectedArrayEntries +( + vtkDataArraySelection* select, + const partInfo& selector +) +{ + stringList selections(selector.size()); + label nElem = 0; + + for (int elemI = selector.start(); elemI < selector.end(); ++elemI) + { + if (select->GetArraySetting(elemI)) + { + selections[nElem++] = select->GetArrayName(elemI); + } + } + selections.setSize(nElem); + + + if (debug) + { + Info<< "available("; + for (int elemI = selector.start(); elemI < selector.end(); ++elemI) + { + Info<< " \"" << select->GetArrayName(elemI) << "\""; + } + Info<< " )\nselected("; + + forAll(selections, elemI) + { + Info<< " " << selections[elemI]; + } + Info<< " )\n"; + } + + return selections; +} + + +void Foam::vtkPV3Readers::setSelectedArrayEntries +( + vtkDataArraySelection* select, + const stringList& selections +) +{ + const int nElem = select->GetNumberOfArrays(); + select->DisableAllArrays(); + + // Loop through entries, setting values from selectedEntries + for (int elemI=0; elemI < nElem; ++elemI) + { + string arrayName(select->GetArrayName(elemI)); + + forAll(selections, elemI) + { + if (selections[elemI] == arrayName) + { + select->EnableArray(arrayName.c_str()); + break; + } + } + } +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + + +// ************************************************************************* // diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/vtkPV3Readers/vtkPV3Readers.H b/applications/utilities/postProcessing/graphics/PV3Readers/vtkPV3Readers/vtkPV3Readers.H new file mode 100644 index 0000000000..fba4da5d94 --- /dev/null +++ b/applications/utilities/postProcessing/graphics/PV3Readers/vtkPV3Readers/vtkPV3Readers.H @@ -0,0 +1,229 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-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 + +Namespace + Foam::vtkPV3Readers + +Description + A collection of helper functions when building a reader interface in + ParaView3. + +SourceFiles + vtkPV3Readers.C + +\*---------------------------------------------------------------------------*/ + +#ifndef vtkPV3Readers_H +#define vtkPV3Readers_H + +// do not include legacy strstream headers +#ifndef VTK_EXCLUDE_STRSTREAM_HEADERS +# define VTK_EXCLUDE_STRSTREAM_HEADERS +#endif + +#include "className.H" +#include "fileName.H" +#include "stringList.H" +#include "wordList.H" +#include "HashSet.H" + + +// * * * * * * * * * * * * * Forward Declarations * * * * * * * * * * * * * // + +class vtkDataArraySelection; +class vtkDataSet; +class vtkPoints; +class vtkPV3FoamReader; +class vtkRenderer; +class vtkTextActor; +class vtkMultiBlockDataSet; +class vtkPolyData; +class vtkUnstructuredGrid; +class vtkIndent; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace vtkPV3Readers +{ + //- Declare name of the class and its debug switch + NamespaceName("vtkPV3Readers"); + + //- Bookkeeping for GUI checklists and the multi-block organization + class partInfo + { + const char *name_; + int block_; + int start_; + int size_; + + public: + + partInfo(const char *name, const int blockNo=0) + : + name_(name), + block_(blockNo), + start_(-1), + size_(0) + {} + + //- Return the block holding these datasets + int block() const + { + return block_; + } + + //- Assign block number, return previous value + int block(int blockNo) + { + int prev = block_; + block_ = blockNo; + return prev; + } + + const char* name() const + { + return name_; + } + + int start() const + { + return start_; + } + + int end() const + { + return start_ + size_; + } + + int size() const + { + return size_; + } + + bool empty() const + { + return !size_; + } + + void reset() + { + start_ = -1; + size_ = 0; + } + + //- Assign new start and reset the size + void operator=(const int i) + { + start_ = i; + size_ = 0; + } + + //- Increment the size + void operator+=(const int n) + { + size_ += n; + } + }; + + + //- Convenience method use to convert the readers from VTK 5 + // multiblock API to the current composite data infrastructure + void AddToBlock + ( + vtkMultiBlockDataSet* output, + vtkDataSet* dataset, + const partInfo& selector, + const label datasetNo, + const std::string& datasetName + ); + + + //- Convenience method use to convert the readers from VTK 5 + // multiblock API to the current composite data infrastructure + vtkDataSet* GetDataSetFromBlock + ( + vtkMultiBlockDataSet* output, + const partInfo& selector, + const label datasetNo + ); + + //- Convenience method use to convert the readers from VTK 5 + // multiblock API to the current composite data infrastructure + // ununsed at the moment + label GetNumberOfDataSets + ( + vtkMultiBlockDataSet* output, + const partInfo& selector + ); + + + //- Retrieve the current selections as a wordHashSet + wordHashSet getSelected + ( + vtkDataArraySelection* select + ); + + + //- Retrieve a sub-list of the current selections + wordHashSet getSelected + ( + vtkDataArraySelection*, + const partInfo& + ); + + + //- Retrieve the current selections + stringList getSelectedArrayEntries(vtkDataArraySelection*); + + //- Retrieve a sub-list of the current selections + stringList getSelectedArrayEntries + ( + vtkDataArraySelection* select, + const partInfo& selector + ); + + + //- Set selection(s) + void setSelectedArrayEntries + ( + vtkDataArraySelection*, + const stringList& + ); + + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace vtkPV3 + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/mesh/blockMesh/blockMesh/blockMesh.C b/src/mesh/blockMesh/blockMesh/blockMesh.C index 4d499ea943..1ed0d44a7e 100644 --- a/src/mesh/blockMesh/blockMesh/blockMesh.C +++ b/src/mesh/blockMesh/blockMesh/blockMesh.C @@ -78,6 +78,12 @@ const Foam::polyMesh& Foam::blockMesh::topology() const } +Foam::scalar Foam::blockMesh::scaleFactor() const +{ + return scaleFactor_; +} + + const Foam::pointField& Foam::blockMesh::points() const { if (points_.empty()) diff --git a/src/mesh/blockMesh/blockMesh/blockMesh.H b/src/mesh/blockMesh/blockMesh/blockMesh.H index 6e67506a79..0c423a9b83 100644 --- a/src/mesh/blockMesh/blockMesh/blockMesh.H +++ b/src/mesh/blockMesh/blockMesh/blockMesh.H @@ -144,6 +144,7 @@ public: // Access //- Reference to point field defining the block mesh + // these points have not been scaled by scaleFactor const pointField& blockPointField() const; const polyMesh& topology() const; @@ -153,6 +154,11 @@ public: return edges_; } + //- The scaling factor used to convert to meters + scalar scaleFactor() const; + + //- The points for the entire mesh + // these points have been scaled by scaleFactor const pointField& points() const; const cellShapeList& cells() const; From 83cee1cb68ec0391402bf540719ca116c20ec170 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Fri, 23 Oct 2009 00:33:42 +0200 Subject: [PATCH 04/18] 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 --- .../PV3FoamReader/CMakeLists.txt | 5 +- .../PV3FoamReader/PV3FoamReader_SM.xml | 42 +++--- .../PV3FoamReader/pqPV3FoamReaderPanel.cxx | 126 ++++++++++++++++++ .../PV3FoamReader/pqPV3FoamReaderPanel.h | 102 +++++++++++--- .../PV3FoamReader/vtkPV3FoamReader.cxx | 58 ++++++-- .../PV3FoamReader/vtkPV3FoamReader.h | 82 ++++++++---- .../PV3blockMeshReader/CMakeLists.txt | 7 +- .../PV3blockMeshReader_SM.xml | 11 +- .../pqPV3blockMeshReaderPanel.cxx | 100 ++++++++++++++ .../pqPV3blockMeshReaderPanel.h | 98 +++++++++++--- .../vtkPV3blockMeshReader.cxx | 60 +++++++-- .../vtkPV3blockMeshReader.h | 77 +++++++---- .../vtkPV3blockMesh/vtkOpenFOAMPoints.H | 2 +- .../vtkPV3blockMesh/vtkPV3blockMesh.C | 2 +- .../vtkPV3blockMesh/vtkPV3blockMesh.H | 2 +- .../vtkPV3blockMesh/vtkPV3blockMeshConvert.C | 2 +- .../vtkPV3blockMesh/vtkPV3blockMeshUtils.C | 2 +- 17 files changed, 629 insertions(+), 149 deletions(-) create mode 100644 applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/pqPV3FoamReaderPanel.cxx create mode 100644 applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/pqPV3blockMeshReaderPanel.cxx diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/CMakeLists.txt b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/CMakeLists.txt index 7702f58039..ea50923e6a 100644 --- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/CMakeLists.txt +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/CMakeLists.txt @@ -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 ) diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/PV3FoamReader_SM.xml b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/PV3FoamReader_SM.xml index a78bceb7d5..8506772e5c 100644 --- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/PV3FoamReader_SM.xml +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/PV3FoamReader_SM.xml @@ -16,6 +16,21 @@ + + + + + Cache the fvMesh in memory. + + + + @@ -83,21 +99,7 @@ - - - - - Cache the fvMesh in memory. - - - - - + + + + + + + + + diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/pqPV3FoamReaderPanel.cxx b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/pqPV3FoamReaderPanel.cxx new file mode 100644 index 0000000000..cfede9002c --- /dev/null +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/pqPV3FoamReaderPanel.cxx @@ -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 +#include +#include +#include +#include +#include + +// 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()); +} + + +// ************************************************************************* // diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/pqPV3FoamReaderPanel.h b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/pqPV3FoamReaderPanel.h index 3c97b52dfd..fc4f5f9ada 100644 --- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/pqPV3FoamReaderPanel.h +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/pqPV3FoamReaderPanel.h @@ -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 -#include -// -// 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 + +// ************************************************************************* // diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/vtkPV3FoamReader.cxx b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/vtkPV3FoamReader.cxx index 0b5c65dc78..32b01eb795 100644 --- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/vtkPV3FoamReader.cxx +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/vtkPV3FoamReader.cxx @@ -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? } diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/vtkPV3FoamReader.h b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/vtkPV3FoamReader.h index 4a6eb3723e..df73979205 100644 --- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/vtkPV3FoamReader.h +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/vtkPV3FoamReader.h @@ -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: diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/CMakeLists.txt b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/CMakeLists.txt index c5b911f615..3376fa0d91 100644 --- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/CMakeLists.txt +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/CMakeLists.txt @@ -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 ) diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/PV3blockMeshReader_SM.xml b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/PV3blockMeshReader_SM.xml index 5eea03fe2b..2ac4774ff0 100644 --- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/PV3blockMeshReader_SM.xml +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/PV3blockMeshReader_SM.xml @@ -16,14 +16,13 @@ - - @@ -44,7 +43,6 @@ - @@ -93,6 +91,11 @@ + + + + + diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/pqPV3blockMeshReaderPanel.cxx b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/pqPV3blockMeshReaderPanel.cxx new file mode 100644 index 0000000000..45bdb661fc --- /dev/null +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/pqPV3blockMeshReaderPanel.cxx @@ -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 +#include +#include +#include +#include +#include + +// 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()); +} + + +// ************************************************************************* // diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/pqPV3blockMeshReaderPanel.h b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/pqPV3blockMeshReaderPanel.h index 1f3c2ba9b2..8096338315 100644 --- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/pqPV3blockMeshReaderPanel.h +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/pqPV3blockMeshReaderPanel.h @@ -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 -#include -// -// 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 + +// ************************************************************************* // diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/vtkPV3blockMeshReader.cxx b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/vtkPV3blockMeshReader.cxx index 383deeeccc..bf17a60ca3 100644 --- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/vtkPV3blockMeshReader.cxx +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/vtkPV3blockMeshReader.cxx @@ -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 renderViews = smModel->findItems(); - for (int viewI=0; viewIrenderPointNumbers @@ -244,6 +274,8 @@ void vtkPV3blockMeshReader::updatePointNumbersView(const bool show) show ); } + + // use refresh here? } diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/vtkPV3blockMeshReader.h b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/vtkPV3blockMeshReader.h index b26cde357d..ae704d4a3b 100644 --- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/vtkPV3blockMeshReader.h +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/vtkPV3blockMeshReader.h @@ -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 diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkOpenFOAMPoints.H b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkOpenFOAMPoints.H index a8ce36e144..85ddd163b9 100644 --- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkOpenFOAMPoints.H +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkOpenFOAMPoints.H @@ -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 diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMesh.C b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMesh.C index 91424d3b57..e9d36ec91e 100644 --- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMesh.C +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMesh.C @@ -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 diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMesh.H b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMesh.H index 6001267ef8..a159b3cba5 100644 --- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMesh.H +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMesh.H @@ -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 diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMeshConvert.C b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMeshConvert.C index 5ad588bb30..4f76f5ebf2 100644 --- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMeshConvert.C +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMeshConvert.C @@ -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 diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMeshUtils.C b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMeshUtils.C index b948c5e979..bde724d9a7 100644 --- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMeshUtils.C +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMeshUtils.C @@ -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 From d8cf3901d3160e56b7f78700ee16a47aa5f4dd6c Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Tue, 27 Oct 2009 13:55:25 +0100 Subject: [PATCH 05/18] added doc/codingStyleGuide.org for central revision --- doc/codingStyleGuide.org | 275 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 275 insertions(+) create mode 100644 doc/codingStyleGuide.org diff --git a/doc/codingStyleGuide.org b/doc/codingStyleGuide.org new file mode 100644 index 0000000000..d9c5c3c9c6 --- /dev/null +++ b/doc/codingStyleGuide.org @@ -0,0 +1,275 @@ +# -*- mode: org; -*- +# +#+TITLE: OpenFOAM C++ style guide +#+AUTHOR: OpenCFD Ltd. +#+DATE: November 2009 +#+LINK: http://www.opencfd.co.uk +#+OPTIONS: author:nil ^:{} + +* OpenFOAM C++ style guide + +*** General + + 80 character lines max + + The body of control statements (eg, if, else, while, etc). + always delineated with brace brackets + + + stream output + << is always four characters after the start of the stream, so that the << + symbols align, i.e. + + Info<< + os << + + + so + + WarningIn("className::functionName()") + << "Warning message" + + NOT + + WarningIn("className::functionName()") + << "Warning message" + + + no unnecessary class section headers, i.e. remove + + // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + + // Check + + // Edit + + // Write + + if they contain nothing, even if planned for 'future use' + + + class titles are centred + + /*---------------------------------------------------------------------------*\ + Class exampleClass Declaration + \*---------------------------------------------------------------------------*/ + + NOT + + /*---------------------------------------------------------------------------*\ + Class exampleClass Declaration + \*---------------------------------------------------------------------------*/ + +*** .H Files + + header file spacing + Leave two empty lines between sections (as per functions in the .C file etc) + + + use "//- Comment" comments in header file + + add descriptions to class data and functions + + destructor + If adding a comment to the destructor - use //- and code as a normal function: + + //- Destructor + ~className(); + + inline functions + Use inline functions where appropriate in a separate classNameI.H file. + Do not clutter up the header file with function bodies + +*** .C Files + + Do not open/close namespaces in a .C file + Fully scope the function name, i.e. + + Foam::returnType Foam::className::functionName() + + NOT + + namespace Foam + { + ... + + returnType className::functionName() + + ... + } + + EXCEPTION + + When there are multiple levels of namespace, they may be used in the .C + file, i.e. + + namespace Foam + { + namespace compressible + { + namespace RASModels + { + + ... + + } // End namespace RASModels + } // End namespace compressible + } // End namespace Foam + + + Use two empty lines between functions + +*** Coding Practise + + passing data as arguments or return + Pass label and scalar as copy, anything bigger by reference + + const + Use everywhere it is applicable. + + variable initialisation using "=" + + const className& variableName = otherClass.data(); + + NOT + + const className& variableName(otherClass.data()); + + + virtual functions + If a class is virtual - make all derived classes virtual. + +*** Conditional Statements + if (condition) + { + code; + } + + OR + + if + ( + long condition + ) + { + code; + } + + NOT (no space between "if" and "(") + + if(condition) + { + code; + } + +*** `for' Loops + for (i = 0; i < maxI; i++) + { + code; + } + + OR + + for + ( + i = 0; + i < maxI; + i++ + ) + { + code; + } + + NOT (no space between "for" and "(") + + for(i = 0; i < maxI; i++) + { + code; + } + +*** `forAll' loops + like for loops, but + + forAll( + + NOT + + forAll ( + +*** Splitting Over Multiple Lines + + splitting return type and function name + + split initially after the function return type and left align + + + do not put "const" onto it's own line - use a split to keep it with the + function name and arguments. + + so: + + const Foam::longReturnTypeName& + Foam::longClassName::longFunctionName const + + NOT + + const Foam::longReturnTypeName& + Foam::longClassName::longFunctionName const + + NOR + + const Foam::longReturnTypeName& Foam::longClassName::longFunctionName + const + + NOR + + const Foam::longReturnTypeName& Foam::longClassName:: + longFunctionName const + + + + if need to split again, split at the function name (leaving behind the + preceding scoping "::"'s), and again, left align, i.e. + + const Foam::longReturnTypeName& + Foam::veryveryveryverylongClassName:: + veryveryveryverylongFunctionName const + + + splitting long lines at an "=" + + Indent after split + + variableName = + longClassName.longFunctionName(longArgument); + + OR (where necessary) + + variableName = + longClassName.longFunctionName + ( + longArgument1, + longArgument2 + ); + + NOT + + variableName = + longClassName.longFunctionName(longArgument); + + NOR + + variableName = longClassName.longFunctionName + ( + longArgument1, + longArgument2 + ); + +*** Maths and Logic + + operator spacing + + a + b, a - b + + a*b, a/b + + a & b, a ^ b + + a = b, a != b + + a < b, a > b, a >= b, a <= b + + a || b, a && b + + + splitting formulae over several lines + Split and indent as per "splitting long lines at an "="" + with the operator on the lower line. Align operator so that first + variable, function or bracket on the next line is 4 spaces indented i.e. + + variableName = + a*(a + b) + - exp(c/d) + *(k + t) + + + splitting logical tests over several lines + + indent operator so that the next variable to test is aligned with the + four space indentation, i.e. + + if + ( + a == true + && b == c + ) From 55a89e9db3d78dca419db5f10256b60a1306d076 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Fri, 30 Oct 2009 18:31:28 +0100 Subject: [PATCH 06/18] added HashTbl as development replacement for HashTable - rename to HashTable later when it is considered stable --- applications/test/HashTable3/Make/files | 3 + applications/test/HashTable3/Make/options | 2 + applications/test/HashTable3/hashTableTest3.C | 83 +++ src/OpenFOAM/Make/files | 1 + .../containers/HashTables/HashTbl/HashTbl.C | 665 ++++++++++++++++++ .../containers/HashTables/HashTbl/HashTbl.H | 466 ++++++++++++ .../containers/HashTables/HashTbl/HashTblI.H | 548 +++++++++++++++ .../containers/HashTables/HashTbl/HashTblIO.C | 246 +++++++ .../HashTables/HashTbl/HashTblName.C | 33 + 9 files changed, 2047 insertions(+) create mode 100644 applications/test/HashTable3/Make/files create mode 100644 applications/test/HashTable3/Make/options create mode 100644 applications/test/HashTable3/hashTableTest3.C create mode 100644 src/OpenFOAM/containers/HashTables/HashTbl/HashTbl.C create mode 100644 src/OpenFOAM/containers/HashTables/HashTbl/HashTbl.H create mode 100644 src/OpenFOAM/containers/HashTables/HashTbl/HashTblI.H create mode 100644 src/OpenFOAM/containers/HashTables/HashTbl/HashTblIO.C create mode 100644 src/OpenFOAM/containers/HashTables/HashTbl/HashTblName.C diff --git a/applications/test/HashTable3/Make/files b/applications/test/HashTable3/Make/files new file mode 100644 index 0000000000..e8ec193ffa --- /dev/null +++ b/applications/test/HashTable3/Make/files @@ -0,0 +1,3 @@ +hashTableTest3.C + +EXE = $(FOAM_USER_APPBIN)/hashTableTest3 diff --git a/applications/test/HashTable3/Make/options b/applications/test/HashTable3/Make/options new file mode 100644 index 0000000000..6a9e9810b3 --- /dev/null +++ b/applications/test/HashTable3/Make/options @@ -0,0 +1,2 @@ +/* EXE_INC = -I$(LIB_SRC)/cfdTools/include */ +/* EXE_LIBS = -lfiniteVolume */ diff --git a/applications/test/HashTable3/hashTableTest3.C b/applications/test/HashTable3/hashTableTest3.C new file mode 100644 index 0000000000..422e35696c --- /dev/null +++ b/applications/test/HashTable3/hashTableTest3.C @@ -0,0 +1,83 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 + +Description + + Test speeds for some HashTable operations + +\*---------------------------------------------------------------------------*/ + +#include "argList.H" +#include "HashTable.H" +#include "HashPtrTable.H" +#include "Map.H" +#include "StaticHashTable.H" +#include "HashTbl.H" +#include "cpuTime.H" + +using namespace Foam; + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// Main program: + +int main(int argc, char *argv[]) +{ + const label nLoops = 30; + const label nBase = 100000; + const label nSize = nLoops * nBase; + + cpuTime timer; + + // ie, a + // Map