[paraview] 01/05: Imported Upstream version 5.1.2+dfsg1
Anton Gladky
gladk at moszumanska.debian.org
Tue Aug 16 19:55:08 UTC 2016
This is an automated email from the git hooks/post-receive script.
gladk pushed a commit to branch master
in repository paraview.
commit 482f42d80d022f6b6add731258ce3906012ff9c1
Author: Anton Gladky <gladk at debian.org>
Date: Fri Aug 12 21:12:02 2016 +0200
Imported Upstream version 5.1.2+dfsg1
---
.../ParaViewDocumentationInitializer.cxx | 2 -
Applications/ParaView/Testing/XML/CMakeLists.txt | 5 +-
.../ParaView/Testing/XML/TestOpacityRendering.xml | 11 +
CMakeLists.txt | 2 +-
Examples/Catalyst/CMakeLists.txt | 1 +
.../CxxMappedDataArrayExample/FEDriver.cxx | 6 +-
.../Catalyst/CxxSOADataArrayExample/CMakeLists.txt | 38 +
.../Catalyst/CxxSOADataArrayExample/FEAdaptor.cxx | 155 +++++
.../Catalyst/CxxSOADataArrayExample/FEAdaptor.h | 17 +
.../CxxSOADataArrayExample/FEDataStructures.cxx | 162 +++++
.../CxxSOADataArrayExample/FEDataStructures.h | 41 ++
.../FEDriver.cxx | 6 +-
.../SampleScripts/feslicescript.py | 93 +++
Examples/Catalyst/PythonFullExample/coprocessor.py | 87 +--
Examples/Catalyst/PythonFullExample/fedriver.py | 4 +-
Examples/Catalyst/README | 5 +
.../SMApplication/Resources/proxies_mpi.xml | 24 +-
Testing/Data/Baseline/TestOpacityRendering.png.md5 | 1 +
.../vtkqttesting/pqAbstractItemViewEventPlayer.cxx | 6 +-
.../pqAbstractItemViewEventPlayerBase.cxx | 6 +-
.../pqAbstractMiscellaneousEventPlayer.cxx | 18 +-
.../pqAbstractMiscellaneousEventPlayer.h | 18 +-
.../vtkqttesting/pqTreeViewEventPlayer.cxx | 6 +-
ThirdParty/lz4/vtklz4/CMakeLists.txt | 13 +-
ThirdParty/pugixml/CMakeLists.txt | 14 +-
VTK/CMake/FindHDF5.cmake | 6 +-
VTK/CMake/NewCMake/CMakeParseArguments.cmake | 21 +
VTK/CMake/NewCMake/FindHDF5.cmake | 772 +++++++++++++++++++++
.../NewCMake/FindPackageHandleStandardArgs.cmake | 396 +++++++++++
VTK/CMake/NewCMake/FindPackageMessage.cmake | 57 ++
.../NewCMake/SelectLibraryConfigurations.cmake | 81 +++
...tHeader.cmake => VTKGenerateExportHeader.cmake} | 64 +-
VTK/CMake/vtkCompilerExtras.cmake | 2 +-
VTK/CMake/vtkModuleMacros.cmake | 19 +-
VTK/CMake/vtkModuleTop.cmake | 4 +-
...ortheader.cmake.in => vtkexportheader.cmake.in} | 0
VTK/CMakeLists.txt | 1 +
.../vtkPUnstructuredGridGhostCellsGenerator.cxx | 8 +-
.../vtkPUnstructuredGridGhostCellsGenerator.h | 10 +
VTK/IO/Exodus/vtkExodusIIReader.cxx | 16 +-
VTK/IO/GDAL/Testing/Cxx/CMakeLists.txt | 9 +
.../GDAL/Testing/Cxx/TestGDALRasterNoDataValue.cxx | 72 ++
VTK/IO/GDAL/Testing/Cxx/TestGDALRasterPalette.cxx | 108 +++
.../Data/Baseline/TestGDALRasterPalette.png.md5 | 1 +
.../Data/Input/TestGDALRasterNoDataValue.tif.md5 | 1 +
.../Data/Input/TestGDALRasterPalette.tif.md5 | 1 +
VTK/IO/GDAL/vtkGDALRasterReader.cxx | 107 ++-
VTK/IO/GDAL/vtkGDALRasterReader.h | 2 +-
VTK/IO/Geometry/vtkOpenFOAMReader.cxx | 9 +
VTK/Rendering/OpenGL2/vtkDualDepthPeelingPass.cxx | 48 +-
VTK/Rendering/OpenGL2/vtkDualDepthPeelingPass.h | 3 +
VTK/Rendering/OpenGL2/vtkOpenGLRenderUtilities.cxx | 54 +-
VTK/Rendering/OpenGL2/vtkOpenGLRenderUtilities.h | 14 +-
VTK/Rendering/OpenGL2/vtkOpenGLRenderer.cxx | 14 +
VTK/ThirdParty/hdf5/module.cmake | 8 +
VTK/ThirdParty/xdmf2/vtkxdmf2/CMakeLists.txt | 15 +-
VTK/Wrapping/PythonCore/CMakeLists.txt | 2 +-
Wrapping/Python/paraview/cinemaIO/pv_introspect.py | 10 +-
version.txt | 2 +-
59 files changed, 2490 insertions(+), 188 deletions(-)
diff --git a/Applications/ParaView/Documentation/ParaViewDocumentationInitializer.cxx b/Applications/ParaView/Documentation/ParaViewDocumentationInitializer.cxx
index d097432..fe397a9 100644
--- a/Applications/ParaView/Documentation/ParaViewDocumentationInitializer.cxx
+++ b/Applications/ParaView/Documentation/ParaViewDocumentationInitializer.cxx
@@ -6,7 +6,5 @@
void PARAVIEW_DOCUMENTATION_INIT()
{
-#ifndef BUILD_SHARED_LIBS
Q_INIT_RESOURCE(paraview_documentation);
-#endif
}
diff --git a/Applications/ParaView/Testing/XML/CMakeLists.txt b/Applications/ParaView/Testing/XML/CMakeLists.txt
index 0fa8442..686926d 100644
--- a/Applications/ParaView/Testing/XML/CMakeLists.txt
+++ b/Applications/ParaView/Testing/XML/CMakeLists.txt
@@ -107,7 +107,10 @@ SET (TESTS_WITH_INLINE_COMPARES
${CMAKE_CURRENT_SOURCE_DIR}/XYHistogram.xml
)
-SET (TESTS_WITH_BASELINES)
+SET(TESTS_WITH_BASELINES
+ ${CMAKE_CURRENT_SOURCE_DIR}/TestOpacityRendering.xml
+)
+
if(PARAVIEW_USE_VISITBRIDGE)
list(APPEND TESTS_WITH_BASELINES
${CMAKE_CURRENT_SOURCE_DIR}/VisItBridgeChombo.xml
diff --git a/Applications/ParaView/Testing/XML/TestOpacityRendering.xml b/Applications/ParaView/Testing/XML/TestOpacityRendering.xml
new file mode 100644
index 0000000..89dbf85
--- /dev/null
+++ b/Applications/ParaView/Testing/XML/TestOpacityRendering.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" ?>
+<pqevents>
+ <pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/ViewFrame/ProxyPanel/BackgroundEditor/BackgroundType" command="activated" arguments="Gradient" />
+ <pqevent object="pqClientMainWindow/menubar" command="activate" arguments="menuSources" />
+ <pqevent object="pqClientMainWindow/menubar/menuSources" command="activate" arguments="SphereSource" />
+ <pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/Accept" command="activate" arguments="" />
+ <pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/DisplayFrame/ProxyPanel/ColorEditor/EditColorMap" command="activate" arguments="" />
+ <pqevent object="pqClientMainWindow/1QColorDialog0" command="setChosenColor" arguments="255,0,0" />
+ <pqevent object="pqClientMainWindow/0QColorDialog0" command="done" arguments="1" />
+ <pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/DisplayFrame/ProxyPanel/Opacity/DoubleRangeWidget/Slider" command="set_int" arguments="25" />
+</pqevents>
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d476bb2..bc814f9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -28,7 +28,7 @@
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#==========================================================================
-cmake_minimum_required(VERSION 3.5)
+cmake_minimum_required(VERSION 3.3)
project(ParaView)
diff --git a/Examples/Catalyst/CMakeLists.txt b/Examples/Catalyst/CMakeLists.txt
index 17df5e2..f43d26c 100644
--- a/Examples/Catalyst/CMakeLists.txt
+++ b/Examples/Catalyst/CMakeLists.txt
@@ -34,6 +34,7 @@ add_subdirectory(CxxMappedDataArrayExample)
add_subdirectory(MPISubCommunicatorExample)
add_subdirectory(PythonDolfinExample)
add_subdirectory(CxxParticlePathExample)
+add_subdirectory(CxxSOADataArrayExample)
set(BUILD_FORTRAN_EXAMPLES OFF CACHE BOOL "Build Fortran Catalyst Examples")
if(BUILD_FORTRAN_EXAMPLES)
diff --git a/Examples/Catalyst/CxxMappedDataArrayExample/FEDriver.cxx b/Examples/Catalyst/CxxMappedDataArrayExample/FEDriver.cxx
index a6a5881..1a773d9 100644
--- a/Examples/Catalyst/CxxMappedDataArrayExample/FEDriver.cxx
+++ b/Examples/Catalyst/CxxMappedDataArrayExample/FEDriver.cxx
@@ -10,10 +10,10 @@
// grid. We treat the grid as an unstructured
// grid even though in the example provided it
// would be best described as a vtkImageData.
-// Also, the points are stored in an inconsistent
-// manner with respect to the velocity vector.
+// Also, the points and velocity vector are
+// stored in a structure-of-arrays format.
// This is purposefully done to demonstrate
-// the different approaches for getting data
+// the zero-copy API for getting data
// into Catalyst. Note that through configuration
// that the driver can be run without linking
// to Catalyst.
diff --git a/Examples/Catalyst/CxxSOADataArrayExample/CMakeLists.txt b/Examples/Catalyst/CxxSOADataArrayExample/CMakeLists.txt
new file mode 100644
index 0000000..505daf1
--- /dev/null
+++ b/Examples/Catalyst/CxxSOADataArrayExample/CMakeLists.txt
@@ -0,0 +1,38 @@
+cmake_minimum_required(VERSION 2.8.8)
+project(CxxSOADataArrayExample)
+
+set(USE_CATALYST ON CACHE BOOL "Link the simulator with Catalyst")
+if(USE_CATALYST)
+ find_package(ParaView 4.1 REQUIRED COMPONENTS vtkPVPythonCatalyst)
+ include("${PARAVIEW_USE_FILE}")
+ set(Adaptor_SRCS
+ FEAdaptor.cxx
+ )
+ add_library(CxxSOADataArrayExampleAdaptor ${Adaptor_SRCS})
+ target_link_libraries(CxxSOADataArrayExampleAdaptor vtkPVPythonCatalyst vtkParallelMPI)
+ add_definitions("-DUSE_CATALYST")
+ if(NOT PARAVIEW_USE_MPI)
+ message(SEND_ERROR "ParaView must be built with MPI enabled")
+ endif()
+else()
+ find_package(MPI REQUIRED)
+ include_directories(${MPI_C_INCLUDE_PATH})
+endif()
+
+add_executable(CxxSOADataArrayExample FEDriver.cxx FEDataStructures.cxx)
+if(USE_CATALYST)
+ target_link_libraries(CxxSOADataArrayExample LINK_PRIVATE CxxSOADataArrayExampleAdaptor)
+ include(vtkModuleMacros)
+ include(vtkMPI)
+ vtk_mpi_link(CxxSOADataArrayExample)
+else()
+ target_link_libraries(CxxSOADataArrayExample LINK_PRIVATE ${MPI_LIBRARIES})
+endif()
+
+option(BUILD_TESTING "Build Testing" OFF)
+# Setup testing.
+if (BUILD_TESTING)
+ include(CTest)
+ add_test(NAME CxxSOADataArrayExampleTest COMMAND CxxSOADataArrayExample ${CMAKE_CURRENT_SOURCE_DIR}/SampleScripts/feslicescript.py)
+ set_tests_properties(CxxSOADataArrayExampleTest PROPERTIES LABELS "PARAVIEW;CATALYST")
+endif()
diff --git a/Examples/Catalyst/CxxSOADataArrayExample/FEAdaptor.cxx b/Examples/Catalyst/CxxSOADataArrayExample/FEAdaptor.cxx
new file mode 100644
index 0000000..0ea0b78
--- /dev/null
+++ b/Examples/Catalyst/CxxSOADataArrayExample/FEAdaptor.cxx
@@ -0,0 +1,155 @@
+#include <iostream>
+#include "FEAdaptor.h"
+#include "FEDataStructures.h"
+
+#include <vtkCellData.h>
+#include <vtkCellType.h>
+#include <vtkCPDataDescription.h>
+#include <vtkCPInputDataDescription.h>
+#include <vtkCPProcessor.h>
+#include <vtkCPPythonScriptPipeline.h>
+#include <vtkDoubleArray.h>
+#include <vtkFloatArray.h>
+#include <vtkNew.h>
+#include <vtkPoints.h>
+#include <vtkPointData.h>
+#include <vtkUnstructuredGrid.h>
+
+#include "vtkSOADataArrayTemplate.h"
+
+namespace
+{
+ vtkCPProcessor* Processor = NULL;
+ vtkUnstructuredGrid* VTKGrid;
+
+ void BuildVTKGrid(Grid& grid)
+ {
+ // create the points information
+ vtkSOADataArrayTemplate<double>* pointArray = vtkSOADataArrayTemplate<double>::New();
+ pointArray->SetNumberOfComponents(3);
+ pointArray->SetNumberOfTuples(grid.GetNumberOfPoints());
+ pointArray->SetArray(0, grid.GetPointsArray(), grid.GetNumberOfPoints(), false, true);
+ pointArray->SetArray(1, grid.GetPointsArray()+grid.GetNumberOfPoints(), grid.GetNumberOfPoints(), false, true);
+ pointArray->SetArray(2, grid.GetPointsArray()+2*grid.GetNumberOfPoints(), grid.GetNumberOfPoints(), false, true);
+
+ vtkNew<vtkPoints> points;
+ points->SetData(pointArray);
+ pointArray->Delete();
+ VTKGrid->SetPoints(points.GetPointer());
+
+ // create the cells
+ size_t numCells = grid.GetNumberOfCells();
+ VTKGrid->Allocate(static_cast<vtkIdType>(numCells*9));
+ for(size_t cell=0;cell<numCells;cell++)
+ {
+ unsigned int* cellPoints = grid.GetCellPoints(cell);
+ vtkIdType tmp[8] = {cellPoints[0], cellPoints[1], cellPoints[2], cellPoints[3],
+ cellPoints[4], cellPoints[5], cellPoints[6], cellPoints[7]};
+ VTKGrid->InsertNextCell(VTK_HEXAHEDRON, 8, tmp);
+ }
+ }
+
+ void UpdateVTKAttributes(Grid& grid, Attributes& attributes)
+ {
+ if(VTKGrid->GetPointData()->GetNumberOfArrays() == 0)
+ {
+ // velocity array
+ vtkSOADataArrayTemplate<double>* velocity = vtkSOADataArrayTemplate<double>::New();
+ velocity->SetNumberOfComponents(3);
+ velocity->SetNumberOfTuples(grid.GetNumberOfPoints());
+ velocity->SetName("velocity");
+ VTKGrid->GetPointData()->AddArray(velocity);
+ velocity->Delete();
+ }
+ vtkSOADataArrayTemplate<double>* velocity =
+ vtkSOADataArrayTemplate<double>::SafeDownCast(VTKGrid->GetPointData()->GetArray("velocity"));
+ velocity->SetArray(0, attributes.GetVelocityArray(), grid.GetNumberOfPoints(), false, true);
+ velocity->SetArray(1, attributes.GetVelocityArray()+grid.GetNumberOfPoints(), grid.GetNumberOfPoints(), false, true);
+ velocity->SetArray(2, attributes.GetVelocityArray()+2*grid.GetNumberOfPoints(), grid.GetNumberOfPoints(), false, true);
+
+ if(VTKGrid->GetCellData()->GetNumberOfArrays() == 0)
+ {
+ // pressure array
+ vtkNew<vtkFloatArray> pressure;
+ pressure->SetName("pressure");
+ pressure->SetNumberOfComponents(1);
+ VTKGrid->GetCellData()->AddArray(pressure.GetPointer());
+ }
+ vtkFloatArray* pressure = vtkFloatArray::SafeDownCast(
+ VTKGrid->GetCellData()->GetArray("pressure"));
+ // The pressure array is a scalar array so we can reuse
+ // memory as long as we ordered the points properly.
+ float* pressureData = attributes.GetPressureArray();
+ pressure->SetArray(pressureData, static_cast<vtkIdType>(grid.GetNumberOfCells()), 1);
+ }
+
+ void BuildVTKDataStructures(Grid& grid, Attributes& attributes)
+ {
+ if(VTKGrid == NULL)
+ {
+ // The grid structure isn't changing so we only build it
+ // the first time it's needed. If we needed the memory
+ // we could delete it and rebuild as necessary.
+ VTKGrid = vtkUnstructuredGrid::New();
+ BuildVTKGrid(grid);
+ }
+ UpdateVTKAttributes(grid, attributes);
+ }
+}
+
+namespace FEAdaptor
+{
+
+ void Initialize(int numScripts, char* scripts[])
+ {
+ if(Processor == NULL)
+ {
+ Processor = vtkCPProcessor::New();
+ Processor->Initialize();
+ }
+ else
+ {
+ Processor->RemoveAllPipelines();
+ }
+ for(int i=1;i<numScripts;i++)
+ {
+ vtkNew<vtkCPPythonScriptPipeline> pipeline;
+ pipeline->Initialize(scripts[i]);
+ Processor->AddPipeline(pipeline.GetPointer());
+ }
+ }
+
+ void Finalize()
+ {
+ if(Processor)
+ {
+ Processor->Delete();
+ Processor = NULL;
+ }
+ if(VTKGrid)
+ {
+ VTKGrid->Delete();
+ VTKGrid = NULL;
+ }
+ }
+
+ void CoProcess(Grid& grid, Attributes& attributes, double time,
+ unsigned int timeStep, bool lastTimeStep)
+ {
+ vtkNew<vtkCPDataDescription> dataDescription;
+ dataDescription->AddInput("input");
+ dataDescription->SetTimeData(time, timeStep);
+ if(lastTimeStep == true)
+ {
+ // assume that we want to all the pipelines to execute if it
+ // is the last time step.
+ dataDescription->ForceOutputOn();
+ }
+ if(Processor->RequestDataDescription(dataDescription.GetPointer()) != 0)
+ {
+ BuildVTKDataStructures(grid, attributes);
+ dataDescription->GetInputDescriptionByName("input")->SetGrid(VTKGrid);
+ Processor->CoProcess(dataDescription.GetPointer());
+ }
+ }
+} // end of Catalyst namespace
diff --git a/Examples/Catalyst/CxxSOADataArrayExample/FEAdaptor.h b/Examples/Catalyst/CxxSOADataArrayExample/FEAdaptor.h
new file mode 100644
index 0000000..671565e
--- /dev/null
+++ b/Examples/Catalyst/CxxSOADataArrayExample/FEAdaptor.h
@@ -0,0 +1,17 @@
+#ifndef FEADAPTOR_HEADER
+#define FEADAPTOR_HEADER
+
+class Attributes;
+class Grid;
+
+namespace FEAdaptor
+{
+ void Initialize(int numScripts, char* scripts[]);
+
+ void Finalize();
+
+ void CoProcess(Grid& grid, Attributes& attributes, double time,
+ unsigned int timeStep, bool lastTimeStep);
+}
+
+#endif
diff --git a/Examples/Catalyst/CxxSOADataArrayExample/FEDataStructures.cxx b/Examples/Catalyst/CxxSOADataArrayExample/FEDataStructures.cxx
new file mode 100644
index 0000000..6e50361
--- /dev/null
+++ b/Examples/Catalyst/CxxSOADataArrayExample/FEDataStructures.cxx
@@ -0,0 +1,162 @@
+#include "FEDataStructures.h"
+
+#include <mpi.h>
+#include <iostream>
+
+Grid::Grid()
+{}
+
+void Grid::Initialize(const unsigned int numPoints[3], const double spacing[3] )
+{
+ if(numPoints[0] == 0 || numPoints[1] == 0 || numPoints[2] == 0)
+ {
+ std::cerr << "Must have a non-zero amount of points in each direction.\n";
+ }
+ // in parallel, we do a simple partitioning in the x-direction.
+ int mpiSize = 1;
+ int mpiRank = 0;
+ MPI_Comm_rank(MPI_COMM_WORLD, &mpiRank);
+ MPI_Comm_size(MPI_COMM_WORLD, &mpiSize);
+
+ unsigned int startXPoint = mpiRank*numPoints[0]/mpiSize;
+ unsigned int endXPoint = (mpiRank+1)*numPoints[0]/mpiSize;
+ if(mpiSize != mpiRank+1)
+ {
+ endXPoint++;
+ }
+
+ // create the points -- slowest in the x and fastest in the z directions
+ // all of the x coordinates are stored first, then y coordinates and
+ // finally z coordinates (e.g. x[0], x[1], ..., x[n-1], y[0], y[1], ...,
+ // y[n-1], z[0], z[1], ..., z[n-1]) which is OPPOSITE of VTK's ordering.
+ size_t numTotalPoints = (endXPoint-startXPoint)*numPoints[1]*numPoints[2];
+ this->Points.resize(3*numTotalPoints);
+ size_t counter = 0;
+ for(unsigned int i=startXPoint;i<endXPoint;i++)
+ {
+ for(unsigned int j=0;j<numPoints[1];j++)
+ {
+ for(unsigned int k=0;k<numPoints[2];k++)
+ {
+ this->Points[counter] = i*spacing[0];
+ this->Points[numTotalPoints+counter] = j*spacing[1];
+ this->Points[2*numTotalPoints+counter] = k*spacing[2];
+ counter++;
+ }
+ }
+ }
+
+ // create the hex cells
+ unsigned int cellPoints[8];
+ unsigned int numXPoints = endXPoint - startXPoint;
+ for(unsigned int i=0;i<numXPoints-1;i++)
+ {
+ for(unsigned int j=0;j<numPoints[1]-1;j++)
+ {
+ for(unsigned int k=0;k<numPoints[2]-1;k++)
+ {
+ cellPoints[0] = i*numPoints[1]*numPoints[2] +
+ j*numPoints[2] + k;
+ cellPoints[1] = (i+1)*numPoints[1]*numPoints[2] +
+ j*numPoints[2] + k;
+ cellPoints[2] = (i+1)*numPoints[1]*numPoints[2] +
+ (j+1)*numPoints[2] + k;
+ cellPoints[3] = i*numPoints[1]*numPoints[2] +
+ (j+1)*numPoints[2] + k;
+ cellPoints[4] = i*numPoints[1]*numPoints[2] +
+ j*numPoints[2] + k+1;
+ cellPoints[5] = (i+1)*numPoints[1]*numPoints[2] +
+ j*numPoints[2] + k+1;
+ cellPoints[6] = (i+1)*numPoints[1]*numPoints[2] +
+ (j+1)*numPoints[2] + k+1;
+ cellPoints[7] = i*numPoints[1]*numPoints[2] +
+ (j+1)*numPoints[2] + k+1;
+ std::copy(cellPoints, cellPoints+8, std::back_inserter(this->Cells));
+ }
+ }
+ }
+}
+
+size_t Grid::GetNumberOfPoints()
+{
+ return this->Points.size()/3;
+}
+
+size_t Grid::GetNumberOfCells()
+{
+ return this->Cells.size()/8;
+}
+
+double* Grid::GetPointsArray()
+{
+ if(this->Points.empty())
+ {
+ return NULL;
+ }
+ return &(this->Points[0]);
+}
+
+bool Grid::GetPoint(size_t pointId, double coord[3])
+{
+ if(pointId >= this->Points.size()/3)
+ {
+ return false;
+ }
+ coord[0] = this->Points[pointId];
+ coord[1] = this->Points[pointId+this->GetNumberOfPoints()];
+ coord[2] = this->Points[pointId+2*this->GetNumberOfPoints()];
+ return true;
+}
+
+unsigned int* Grid::GetCellPoints(size_t cellId)
+{
+ if(cellId >= this->Cells.size())
+ {
+ return NULL;
+ }
+ return &(this->Cells[cellId*8]);
+}
+
+Attributes::Attributes()
+{
+ this->GridPtr = NULL;
+}
+
+void Attributes::Initialize(Grid* grid)
+{
+ this->GridPtr = grid;
+}
+
+void Attributes::UpdateFields(double time)
+{
+ size_t numPoints = this->GridPtr->GetNumberOfPoints();
+ this->Velocity.resize(numPoints*3);
+ double coord[3] = {0, 0, 0};
+ for(size_t pt=0;pt<numPoints;pt++)
+ {
+ this->GridPtr->GetPoint(pt, coord);
+ this->Velocity[pt] = coord[1]*time;
+ }
+ std::fill(this->Velocity.begin()+numPoints, this->Velocity.end(), 0.);
+ size_t numCells = this->GridPtr->GetNumberOfCells();
+ this->Pressure.resize(numCells);
+ std::fill(this->Pressure.begin(), this->Pressure.end(), 1.);
+}
+
+double* Attributes::GetVelocityArray()
+{
+ if(this->Velocity.empty())
+ {
+ return NULL;
+ }
+ return &this->Velocity[0];
+}
+
+float* Attributes::GetPressureArray()
+{
+ if(this->Pressure.empty())
+ {
+ return NULL;
+ }
+ return &this->Pressure[0];
+}
diff --git a/Examples/Catalyst/CxxSOADataArrayExample/FEDataStructures.h b/Examples/Catalyst/CxxSOADataArrayExample/FEDataStructures.h
new file mode 100644
index 0000000..daf145a
--- /dev/null
+++ b/Examples/Catalyst/CxxSOADataArrayExample/FEDataStructures.h
@@ -0,0 +1,41 @@
+#ifndef FEDATASTRUCTURES_HEADER
+#define FEDATASTRUCTURES_HEADER
+
+#include <cstddef>
+#include <vector>
+
+class Grid
+{
+public:
+ Grid();
+ void Initialize(const unsigned int numPoints[3], const double spacing[3]);
+ size_t GetNumberOfPoints();
+ size_t GetNumberOfCells();
+ double* GetPointsArray();
+ bool GetPoint(size_t pointId, double coord[3]);
+ unsigned int* GetCellPoints(size_t cellId);
+private:
+ std::vector<double> Points;
+ std::vector<unsigned int> Cells;
+};
+
+class Attributes
+{
+// A class for generating and storing point and cell fields.
+// Velocity is stored at the points and pressure is stored
+// for the cells. The current velocity profile is for a
+// shearing flow with U(y,t) = y*t, V = 0 and W = 0.
+// Pressure is constant through the domain.
+public:
+ Attributes();
+ void Initialize(Grid* grid);
+ void UpdateFields(double time);
+ double* GetVelocityArray();
+ float* GetPressureArray();
+
+private:
+ std::vector<double> Velocity;
+ std::vector<float> Pressure;
+ Grid* GridPtr;
+};
+#endif
diff --git a/Examples/Catalyst/CxxMappedDataArrayExample/FEDriver.cxx b/Examples/Catalyst/CxxSOADataArrayExample/FEDriver.cxx
similarity index 89%
copy from Examples/Catalyst/CxxMappedDataArrayExample/FEDriver.cxx
copy to Examples/Catalyst/CxxSOADataArrayExample/FEDriver.cxx
index a6a5881..1a773d9 100644
--- a/Examples/Catalyst/CxxMappedDataArrayExample/FEDriver.cxx
+++ b/Examples/Catalyst/CxxSOADataArrayExample/FEDriver.cxx
@@ -10,10 +10,10 @@
// grid. We treat the grid as an unstructured
// grid even though in the example provided it
// would be best described as a vtkImageData.
-// Also, the points are stored in an inconsistent
-// manner with respect to the velocity vector.
+// Also, the points and velocity vector are
+// stored in a structure-of-arrays format.
// This is purposefully done to demonstrate
-// the different approaches for getting data
+// the zero-copy API for getting data
// into Catalyst. Note that through configuration
// that the driver can be run without linking
// to Catalyst.
diff --git a/Examples/Catalyst/CxxSOADataArrayExample/SampleScripts/feslicescript.py b/Examples/Catalyst/CxxSOADataArrayExample/SampleScripts/feslicescript.py
new file mode 100644
index 0000000..21e9d75
--- /dev/null
+++ b/Examples/Catalyst/CxxSOADataArrayExample/SampleScripts/feslicescript.py
@@ -0,0 +1,93 @@
+from paraview.simple import *
+from paraview import coprocessing
+
+#--------------------------------------------------------------
+# Code generated from cpstate.py to create the CoProcessor.
+
+
+# ----------------------- CoProcessor definition -----------------------
+
+def CreateCoProcessor():
+ def _CreatePipeline(coprocessor, datadescription):
+ class Pipeline:
+ filename_3_pvtu = coprocessor.CreateProducer( datadescription, "input" )
+
+ Slice1 = Slice( guiName="Slice1", Crinkleslice=0, SliceOffsetValues=[0.0], Triangulatetheslice=1, SliceType="Plane" )
+ Slice1.SliceType.Offset = 0.0
+ Slice1.SliceType.Origin = [34.5, 32.45, 27.95]
+ Slice1.SliceType.Normal = [1.0, 0.0, 0.0]
+
+ # create a new 'Parallel PolyData Writer'
+ parallelPolyDataWriter1 = servermanager.writers.XMLPPolyDataWriter(Input=Slice1)
+
+ # register the writer with coprocessor
+ # and provide it with information such as the filename to use,
+ # how frequently to write the data, etc.
+ coprocessor.RegisterWriter(parallelPolyDataWriter1, filename='slice_%t.pvtp', freq=10)
+
+ # create a new 'Parallel UnstructuredGrid Writer'
+ unstructuredGridWriter1 = servermanager.writers.XMLPUnstructuredGridWriter(Input=filename_3_pvtu)
+
+ # register the writer with coprocessor
+ # and provide it with information such as the filename to use,
+ # how frequently to write the data, etc.
+ coprocessor.RegisterWriter(unstructuredGridWriter1, filename='fullgrid_%t.pvtu', freq=100)
+
+ return Pipeline()
+
+ class CoProcessor(coprocessing.CoProcessor):
+ def CreatePipeline(self, datadescription):
+ self.Pipeline = _CreatePipeline(self, datadescription)
+
+ coprocessor = CoProcessor()
+ freqs = {'input': [10, 100]}
+ coprocessor.SetUpdateFrequencies(freqs)
+ return coprocessor
+
+#--------------------------------------------------------------
+# Global variables that will hold the pipeline for each timestep
+# Creating the CoProcessor object, doesn't actually create the ParaView pipeline.
+# It will be automatically setup when coprocessor.UpdateProducers() is called the
+# first time.
+coprocessor = CreateCoProcessor()
+
+#--------------------------------------------------------------
+# Enable Live-Visualizaton with ParaView
+coprocessor.EnableLiveVisualization(False)
+
+
+# ---------------------- Data Selection method ----------------------
+
+def RequestDataDescription(datadescription):
+ "Callback to populate the request for current timestep"
+ global coprocessor
+ if datadescription.GetForceOutput() == True:
+ # We are just going to request all fields and meshes from the simulation
+ # code/adaptor.
+ for i in range(datadescription.GetNumberOfInputDescriptions()):
+ datadescription.GetInputDescription(i).AllFieldsOn()
+ datadescription.GetInputDescription(i).GenerateMeshOn()
+ return
+
+ # setup requests for all inputs based on the requirements of the
+ # pipeline.
+ coprocessor.LoadRequestedData(datadescription)
+
+# ------------------------ Processing method ------------------------
+
+def DoCoProcessing(datadescription):
+ "Callback to do co-processing for current timestep"
+ global coprocessor
+
+ # Update the coprocessor by providing it the newly generated simulation data.
+ # If the pipeline hasn't been setup yet, this will setup the pipeline.
+ coprocessor.UpdateProducers(datadescription)
+
+ # Write output data, if appropriate.
+ coprocessor.WriteData(datadescription);
+
+ # Write image capture (Last arg: rescale lookup table), if appropriate.
+ coprocessor.WriteImages(datadescription, rescale_lookuptable=False)
+
+ # Live Visualization, if enabled.
+ coprocessor.DoLiveVisualization(datadescription, "localhost", 22222)
diff --git a/Examples/Catalyst/PythonFullExample/coprocessor.py b/Examples/Catalyst/PythonFullExample/coprocessor.py
index 29763bb..5101a1f 100644
--- a/Examples/Catalyst/PythonFullExample/coprocessor.py
+++ b/Examples/Catalyst/PythonFullExample/coprocessor.py
@@ -1,56 +1,57 @@
coProcessor = None
-usecp = True
def initialize():
- global coProcessor, usecp
- if usecp:
- import paraview
- import vtkParallelCorePython
- import vtk
- from mpi4py import MPI
- import os, sys
+ global coProcessor
+ import paraview
+ import vtkParallelCorePython
+ import vtk
+ from mpi4py import MPI
+ import os, sys
- paraview.options.batch = True
- paraview.options.symmetric = True
- import vtkPVClientServerCoreCorePython as CorePython
- try:
- import vtkPVServerManagerApplicationPython as ApplicationPython
- except:
- paraview.print_error("Error: Cannot import vtkPVServerManagerApplicationPython")
+ paraview.options.batch = True
+ paraview.options.symmetric = True
+ import vtkPVClientServerCoreCorePython as CorePython
+ try:
+ import vtkPVServerManagerApplicationPython as ApplicationPython
+ except:
+ paraview.print_error("Error: Cannot import vtkPVServerManagerApplicationPython")
- if not CorePython.vtkProcessModule.GetProcessModule():
- pvoptions = None
- if paraview.options.batch:
- pvoptions = CorePython.vtkPVOptions();
- pvoptions.SetProcessType(CorePython.vtkPVOptions.PVBATCH)
- if paraview.options.symmetric:
- pvoptions.SetSymmetricMPIMode(True)
- ApplicationPython.vtkInitializationHelper.Initialize(sys.executable, CorePython.vtkProcessModule.PROCESS_BATCH, pvoptions)
+ if not CorePython.vtkProcessModule.GetProcessModule():
+ pvoptions = None
+ if paraview.options.batch:
+ pvoptions = CorePython.vtkPVOptions();
+ pvoptions.SetProcessType(CorePython.vtkPVOptions.PVBATCH)
+ if paraview.options.symmetric:
+ pvoptions.SetSymmetricMPIMode(True)
+ ApplicationPython.vtkInitializationHelper.Initialize(sys.executable, CorePython.vtkProcessModule.PROCESS_BATCH, pvoptions)
- import paraview.servermanager as pvsm
- # we need ParaView 4.2 since ParaView 4.1 doesn't properly wrap
- # vtkPVPythonCatalystPython
- if pvsm.vtkSMProxyManager.GetVersionMajor() < 4 or (pvsm.vtkSMProxyManager.GetVersionMajor() == 4 and pvsm.vtkSMProxyManager.GetVersionMinor() < 2):
- print 'Must use ParaView v4.2 or greater'
- sys.exit(0)
+ import paraview.servermanager as pvsm
+ # we need ParaView 4.2 since ParaView 4.1 doesn't properly wrap
+ # vtkPVPythonCatalystPython
+ if pvsm.vtkSMProxyManager.GetVersionMajor() < 4 or (pvsm.vtkSMProxyManager.GetVersionMajor() == 4 and pvsm.vtkSMProxyManager.GetVersionMinor() < 2):
+ print 'Must use ParaView v4.2 or greater'
+ sys.exit(0)
- import numpy
- import vtkPVCatalystPython as catalyst
- import vtkPVPythonCatalystPython as pythoncatalyst
- import paraview.simple
- import paraview.vtk as vtk
- from paraview import numpy_support
- paraview.options.batch = True
- paraview.options.symmetric = True
+ import numpy
+ import vtkPVCatalystPython as catalyst
+ import vtkPVPythonCatalystPython as pythoncatalyst
+ import paraview.simple
+ import paraview.vtk as vtk
+ from paraview import numpy_support
+ paraview.options.batch = True
+ paraview.options.symmetric = True
- coProcessor = catalyst.vtkCPProcessor()
- pm = paraview.servermanager.vtkProcessModule.GetProcessModule()
- from mpi4py import MPI
+ coProcessor = catalyst.vtkCPProcessor()
+ pm = paraview.servermanager.vtkProcessModule.GetProcessModule()
+ from mpi4py import MPI
def finalize():
- global coProcessor, usecp
- if usecp:
- coProcessor.Finalize()
+ global coProcessor
+ coProcessor.Finalize()
+ # if we are running through Python we need to finalize extra stuff
+ # to avoid memory leak messages.
+ import sys, ntpath
+ if ntpath.basename(sys.executable) == 'python':
import vtkPVServerManagerApplicationPython as ApplicationPython
ApplicationPython.vtkInitializationHelper.Finalize()
diff --git a/Examples/Catalyst/PythonFullExample/fedriver.py b/Examples/Catalyst/PythonFullExample/fedriver.py
index 7667cea..12901e9 100644
--- a/Examples/Catalyst/PythonFullExample/fedriver.py
+++ b/Examples/Catalyst/PythonFullExample/fedriver.py
@@ -22,14 +22,12 @@ doCoprocessing = True
if doCoprocessing:
import coprocessor
coprocessor.initialize()
- coprocessor.addscript("cpscript.py")
+ #coprocessor.addscript("cpscript.py")
for i in range(100):
attributes.Update(i)
if doCoprocessing:
- import coprocessor
coprocessor.coprocess(i, i, grid, attributes)
if doCoprocessing:
- import coprocessor
coprocessor.finalize()
diff --git a/Examples/Catalyst/README b/Examples/Catalyst/README
index d0eed05..65e6c92 100644
--- a/Examples/Catalyst/README
+++ b/Examples/Catalyst/README
@@ -44,9 +44,14 @@ correctness of outputs. A description of the examples are:
* CxxMappedDataArrayExample -- An example of an adaptor where we use VTK mapped
arrays to map simulation data structures to
VTK data arrays to save on memory use by Catalyst.
+ Note that this example is deprecated as of
+ ParaView 5.1 in favor of the CxxSOADataArrayExample.
* MPISubCommunicatorExample -- An example where only a subset of the MPI
processes are used for the simulation and Catalyst.
* CxxParticlePathExample -- An example for computing particle paths in situ.
+* CxxSOADataArrayExample -- An example of an adaptor where we use
+ vtkSOADataArrayTemplate to reuse simulation memory
+ for VTK field arrays.
Other objects of interest:
* LICENSE.md -- The license of this software.
diff --git a/ParaViewCore/ServerManager/SMApplication/Resources/proxies_mpi.xml b/ParaViewCore/ServerManager/SMApplication/Resources/proxies_mpi.xml
index 4ae0d48..2a454ba 100644
--- a/ParaViewCore/ServerManager/SMApplication/Resources/proxies_mpi.xml
+++ b/ParaViewCore/ServerManager/SMApplication/Resources/proxies_mpi.xml
@@ -89,12 +89,30 @@
<IntVectorProperty command="SetBuildIfRequired"
default_values="0"
name="BuildIfRequired"
- number_of_elements="1"
- panel_visibility="advanced">
+ number_of_elements="1">
<Documentation>Specify if the filter must generate the ghost cells only
- if required by the pipeline downstream.</Documentation>
+ if required by the pipeline downstream. To force at least a fixed level
+ of ghosts, this must be set to 0 (unchecked).</Documentation>
<BooleanDomain name="bool" />
</IntVectorProperty>
+ <IntVectorProperty command="SetMinimumNumberOfGhostLevels"
+ number_of_elements="1"
+ default_values="1"
+ name="MinimumNumberOfGhostLevels">
+ <IntRangeDomain name="range" min="1" max="10" />
+ <Documentation>
+ When **BuildIfRequired** if off, use this to specify the minimum number of
+ ghost cells to request. The filter may request more ghost levels than indicated if a
+ downstream filter asked for more ghost levels.
+ </Documentation>
+ <Hints>
+ <PropertyWidgetDecorator type="GenericDecorator"
+ mode="enabled_state"
+ property="BuildIfRequired"
+ value="0" />
+ <!-- if BuildIfRequired !=0 , we disable this property -->
+ </Hints>
+ </IntVectorProperty>
<IntVectorProperty command="SetUseGlobalPointIds"
default_values="1"
name="UseGlobalIds"
diff --git a/Testing/Data/Baseline/TestOpacityRendering.png.md5 b/Testing/Data/Baseline/TestOpacityRendering.png.md5
new file mode 100644
index 0000000..494a851
--- /dev/null
+++ b/Testing/Data/Baseline/TestOpacityRendering.png.md5
@@ -0,0 +1 @@
+bc476c6adee1859dc282f08740482f68
diff --git a/ThirdParty/QtTesting/vtkqttesting/pqAbstractItemViewEventPlayer.cxx b/ThirdParty/QtTesting/vtkqttesting/pqAbstractItemViewEventPlayer.cxx
index b5f5c23..de6046b 100644
--- a/ThirdParty/QtTesting/vtkqttesting/pqAbstractItemViewEventPlayer.cxx
+++ b/ThirdParty/QtTesting/vtkqttesting/pqAbstractItemViewEventPlayer.cxx
@@ -41,6 +41,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <QList>
#include <QListWidget>
#include <QWheelEvent>
+#include <QMenu>
#include "pqEventDispatcher.h"
@@ -110,7 +111,10 @@ pqAbstractItemViewEventPlayer::pqAbstractItemViewEventPlayer(QObject* p)
bool pqAbstractItemViewEventPlayer::playEvent(QObject* Object, const QString& Command, const QString& Arguments, bool& Error)
{
QAbstractItemView* object = qobject_cast<QAbstractItemView*>(Object);
- if (!object)
+ QMenu* contextMenu= qobject_cast<QMenu*>(Object);
+ // if this a QMenu (potentially a context menu of the view),
+ // we should not move onto parent
+ if (!object && !contextMenu)
{
// mouse events go to the viewport widget
object = qobject_cast<QAbstractItemView*>(Object->parent());
diff --git a/ThirdParty/QtTesting/vtkqttesting/pqAbstractItemViewEventPlayerBase.cxx b/ThirdParty/QtTesting/vtkqttesting/pqAbstractItemViewEventPlayerBase.cxx
index 1e5227d..5e6e1a3 100644
--- a/ThirdParty/QtTesting/vtkqttesting/pqAbstractItemViewEventPlayerBase.cxx
+++ b/ThirdParty/QtTesting/vtkqttesting/pqAbstractItemViewEventPlayerBase.cxx
@@ -37,6 +37,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//#include <QKeyEvent>
#include <QAbstractItemView>
#include <QDebug>
+#include <QMenu>
//-----------------------------------------------------------------------------
pqAbstractItemViewEventPlayerBase::pqAbstractItemViewEventPlayerBase(QObject* parentObject)
: Superclass(parentObject)
@@ -94,7 +95,10 @@ bool pqAbstractItemViewEventPlayerBase::playEvent(
const QString& arguments, int eventType, bool& error)
{
QAbstractItemView* abstractItemView= qobject_cast<QAbstractItemView*>(object);
- if(!abstractItemView)
+ QMenu* contextMenu= qobject_cast<QMenu*>(object);
+ // if this a QMenu (potentially a context menu of the view),
+ // we should not move onto parent
+ if(!abstractItemView && !contextMenu)
{
// mouse events go to the viewport widget
abstractItemView = qobject_cast<QAbstractItemView*>(object->parent());
diff --git a/ThirdParty/QtTesting/vtkqttesting/pqAbstractMiscellaneousEventPlayer.cxx b/ThirdParty/QtTesting/vtkqttesting/pqAbstractMiscellaneousEventPlayer.cxx
index fc92929..f33c102 100644
--- a/ThirdParty/QtTesting/vtkqttesting/pqAbstractMiscellaneousEventPlayer.cxx
+++ b/ThirdParty/QtTesting/vtkqttesting/pqAbstractMiscellaneousEventPlayer.cxx
@@ -39,6 +39,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <QFile>
#include <QThread>
+#include "pqEventDispatcher.h"
+
// Class that encapsulates the protected function QThread::msleep
class SleeperThread : public QThread
{
@@ -59,7 +61,6 @@ pqAbstractMiscellaneousEventPlayer::pqAbstractMiscellaneousEventPlayer(QObject*
//Allows for execution of testing commands that don't merit their own class
bool pqAbstractMiscellaneousEventPlayer::playEvent(QObject* Object, const QString& Command, const QString& Arguments, bool& Error)
{
-
if (Command == "pause")
{
const int value = Arguments.toInt();
@@ -70,7 +71,20 @@ bool pqAbstractMiscellaneousEventPlayer::playEvent(QObject* Object, const QStrin
Error = true;
qCritical() << "calling pause on unhandled type " << Object;
}
-
+ if (Command == "process_events")
+ {
+ bool valid = false;
+ const int ms = Arguments.toInt(&valid);
+ if (valid)
+ {
+ pqEventDispatcher::processEventsAndWait(ms);
+ }
+ else
+ {
+ pqEventDispatcher::processEvents();
+ }
+ return true;
+ }
return false;
}
diff --git a/ThirdParty/QtTesting/vtkqttesting/pqAbstractMiscellaneousEventPlayer.h b/ThirdParty/QtTesting/vtkqttesting/pqAbstractMiscellaneousEventPlayer.h
index b404ad4..1706dee 100644
--- a/ThirdParty/QtTesting/vtkqttesting/pqAbstractMiscellaneousEventPlayer.h
+++ b/ThirdParty/QtTesting/vtkqttesting/pqAbstractMiscellaneousEventPlayer.h
@@ -34,11 +34,21 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define _pqAbstractMiscellaneousEventPlayer_h
#include "pqWidgetEventPlayer.h"
-/**
-Concrete implementation of pqWidgetEventPlayer that translates high-level ParaView events into low-level Qt events.
-\sa pqEventPlayer
-*/
+/// Event playback handler for a collection of miscellaneous commands.
+/// For these events, the "object" on which the event is triggered is generally
+/// immaterial.
+///
+/// Supported commands are:
+/// \li \c pause : pause the application for a fixed time. Time is specified as
+/// the arguments in milliseconds to pause the application for.
+/// This is a sleep i.e. no events will be processed and the
+/// application will appear frozen.
+/// \li \c process_events: process pending events (including timers, etc.).
+/// Optional time (in milliseconds) may be specified to also pause
+/// the test playback. Unlike "pause" however, this will continue
+/// to process all events arising in the application e.g.
+/// responding to timer events.
class QTTESTING_EXPORT pqAbstractMiscellaneousEventPlayer :
public pqWidgetEventPlayer
{
diff --git a/ThirdParty/QtTesting/vtkqttesting/pqTreeViewEventPlayer.cxx b/ThirdParty/QtTesting/vtkqttesting/pqTreeViewEventPlayer.cxx
index 05c2881..04d00a5 100644
--- a/ThirdParty/QtTesting/vtkqttesting/pqTreeViewEventPlayer.cxx
+++ b/ThirdParty/QtTesting/vtkqttesting/pqTreeViewEventPlayer.cxx
@@ -31,6 +31,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
========================================================================*/
#include "pqTreeViewEventPlayer.h"
#include <QTreeWidget>
+#include <QMenu>
#include <QDebug>
//-----------------------------------------------------------------------------
@@ -50,7 +51,10 @@ bool pqTreeViewEventPlayer::playEvent(
const QString& arguments, int eventType, bool& error)
{
QTreeView* treeView= qobject_cast<QTreeView*>(object);
- if(!treeView)
+ QMenu* contextMenu= qobject_cast<QMenu*>(object);
+ // if this a QMenu (potentially a context menu of the view),
+ // we should not move onto parent
+ if(!treeView && !contextMenu)
{
// mouse events go to the viewport widget
treeView = qobject_cast<QTreeView*>(object->parent());
diff --git a/ThirdParty/lz4/vtklz4/CMakeLists.txt b/ThirdParty/lz4/vtklz4/CMakeLists.txt
index 62fa58b..3a0d527 100644
--- a/ThirdParty/lz4/vtklz4/CMakeLists.txt
+++ b/ThirdParty/lz4/vtklz4/CMakeLists.txt
@@ -41,14 +41,21 @@ add_definitions("-DLZ4_VERSION=\"${CPACK_PACKAGE_VERSION_PATCH}\"")
# XXX(kitware) adding exports for windows shared builds.
vtk_add_library(vtklz4 ${LZ4_SRCS_LIB} vtklz4Exports.h)
-generate_export_header(vtklz4 EXPORT_FILE_NAME vtklz4Exports.h)
+vtk_generate_export_header(vtklz4 EXPORT_FILE_NAME vtklz4Exports.h)
if(BUILD_SHARED_LIBS)
# export flags are only added when building shared libs, they cause
# mismatched visibility warnings when building statically since not all
# libraries that VTK builds don't set visibility flags. Until we get a
# time to do that, we skip visibility flags for static libraries.
- add_compiler_export_flags(my_abi_flags)
- set_property(TARGET vtklz4 APPEND PROPERTY COMPILE_FLAGS "${my_abi_flags}")
+ if(CMAKE_VERSION VERSION_LESS 3.0)
+ #CMake 3.0 deprecates add_compiler_export_flags
+ vtk_add_compiler_export_flags(my_abi_flags)
+ set_property(TARGET ${vtk-module}${target_suffix} APPEND
+ PROPERTY COMPILE_FLAGS "${my_abi_flags}")
+ else()
+ set_property(TARGET ${vtk-module}${target_suffix}
+ PROPERTY CXX_VISIBILITY_PRESET "hidden")
+ endif()
endif()
if(NOT VTK_INSTALL_NO_DEVELOPMENT)
diff --git a/ThirdParty/pugixml/CMakeLists.txt b/ThirdParty/pugixml/CMakeLists.txt
index 20e3c47..01dd326 100644
--- a/ThirdParty/pugixml/CMakeLists.txt
+++ b/ThirdParty/pugixml/CMakeLists.txt
@@ -16,15 +16,21 @@ vtk_add_library(${vtk-module} pugixml.cxx)
# Code copied from vtkModuleMacros.cmake, since vtkModuleMacros doesn't do this
# for vtk_module_third_party().
# Generate the export macro header for symbol visibility/Windows DLL declspec
-generate_export_header(${vtk-module} EXPORT_FILE_NAME ${vtk-module}Module.h)
+vtk_generate_export_header(${vtk-module} EXPORT_FILE_NAME ${vtk-module}Module.h)
get_property(_buildtype TARGET ${vtk-module} PROPERTY TYPE)
if (NOT "${_buildtype}" STREQUAL STATIC_LIBRARY)
# export flags are only added when building shared libs, they cause
# mismatched visibility warnings when building statically since not all
# libraries that VTK builds don't set visibility flags. Until we get a
# time to do that, we skip visibility flags for static libraries.
- add_compiler_export_flags(my_abi_flags)
- set_property(TARGET ${vtk-module} APPEND
- PROPERTY COMPILE_FLAGS "${my_abi_flags}")
+ if(CMAKE_VERSION VERSION_LESS 3.0)
+ #CMake 3.0 deprecates add_compiler_export_flags
+ vtk_add_compiler_export_flags(my_abi_flags)
+ set_property(TARGET ${vtk-module}${target_suffix} APPEND
+ PROPERTY COMPILE_FLAGS "${my_abi_flags}")
+ else()
+ set_property(TARGET ${vtk-module}${target_suffix}
+ PROPERTY CXX_VISIBILITY_PRESET "hidden")
+ endif()
endif()
#------------------------------------------------------------------------------
diff --git a/VTK/CMake/FindHDF5.cmake b/VTK/CMake/FindHDF5.cmake
index 4174578..6d558e3 100644
--- a/VTK/CMake/FindHDF5.cmake
+++ b/VTK/CMake/FindHDF5.cmake
@@ -3,7 +3,11 @@
# (BUG #0014363).
# include the default FindHDF5.cmake.
-include(${CMAKE_ROOT}/Modules/FindHDF5.cmake)
+if(CMAKE_VERSION VERSION_LESS 3.6.1)
+ include(${CMAKE_CURRENT_LIST_DIR}/NewCMake/FindHDF5.cmake)
+else()
+ include(${CMAKE_ROOT}/Modules/FindHDF5.cmake)
+endif()
if(HDF5_FOUND AND (HDF5_IS_PARALLEL OR HDF5_ENABLE_PARALLEL))
include(vtkMPI)
diff --git a/VTK/CMake/NewCMake/CMakeParseArguments.cmake b/VTK/CMake/NewCMake/CMakeParseArguments.cmake
new file mode 100644
index 0000000..fc64ab9
--- /dev/null
+++ b/VTK/CMake/NewCMake/CMakeParseArguments.cmake
@@ -0,0 +1,21 @@
+#.rst:
+# CMakeParseArguments
+# -------------------
+#
+# This module once implemented the :command:`cmake_parse_arguments` command
+# that is now implemented natively by CMake. It is now an empty placeholder
+# for compatibility with projects that include it to get the command from
+# CMake 3.4 and lower.
+
+#=============================================================================
+# Copyright 2010 Alexander Neundorf <neundorf at kde.org>
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+# License text for the above reference.)
diff --git a/VTK/CMake/NewCMake/FindHDF5.cmake b/VTK/CMake/NewCMake/FindHDF5.cmake
new file mode 100644
index 0000000..50e1892
--- /dev/null
+++ b/VTK/CMake/NewCMake/FindHDF5.cmake
@@ -0,0 +1,772 @@
+#.rst:
+# FindHDF5
+# --------
+#
+# Find HDF5, a library for reading and writing self describing array data.
+#
+#
+#
+# This module invokes the HDF5 wrapper compiler that should be installed
+# alongside HDF5. Depending upon the HDF5 Configuration, the wrapper
+# compiler is called either h5cc or h5pcc. If this succeeds, the module
+# will then call the compiler with the -show argument to see what flags
+# are used when compiling an HDF5 client application.
+#
+# The module will optionally accept the COMPONENTS argument. If no
+# COMPONENTS are specified, then the find module will default to finding
+# only the HDF5 C library. If one or more COMPONENTS are specified, the
+# module will attempt to find the language bindings for the specified
+# components. The only valid components are C, CXX, Fortran, HL, and
+# Fortran_HL. If the COMPONENTS argument is not given, the module will
+# attempt to find only the C bindings.
+#
+# On UNIX systems, this module will read the variable
+# HDF5_USE_STATIC_LIBRARIES to determine whether or not to prefer a
+# static link to a dynamic link for HDF5 and all of it's dependencies.
+# To use this feature, make sure that the HDF5_USE_STATIC_LIBRARIES
+# variable is set before the call to find_package.
+#
+# To provide the module with a hint about where to find your HDF5
+# installation, you can set the environment variable HDF5_ROOT. The
+# Find module will then look in this path when searching for HDF5
+# executables, paths, and libraries.
+#
+# Both the serial and parallel HDF5 wrappers are considered and the first
+# directory to contain either one will be used. In the event that both appear
+# in the same directory the serial version is preferentially selected. This
+# behavior can be reversed by setting the variable HDF5_PREFER_PARALLEL to
+# true.
+#
+# In addition to finding the includes and libraries required to compile
+# an HDF5 client application, this module also makes an effort to find
+# tools that come with the HDF5 distribution that may be useful for
+# regression testing.
+#
+# This module will define the following variables:
+#
+# ::
+#
+# HDF5_FOUND - true if HDF5 was found on the system
+# HDF5_VERSION - HDF5 version in format Major.Minor.Release
+# HDF5_INCLUDE_DIRS - Location of the hdf5 includes
+# HDF5_INCLUDE_DIR - Location of the hdf5 includes (deprecated)
+# HDF5_DEFINITIONS - Required compiler definitions for HDF5
+# HDF5_LIBRARIES - Required libraries for all requested bindings
+# HDF5_HL_LIBRARIES - Required libraries for the HDF5 high level API for all
+# bindings, if the HL component is enabled
+#
+# Available components are: C CXX Fortran and HL. For each enabled language
+# binding, a corresponding HDF5_${LANG}_LIBRARIES variable will be defined.
+# If the HL component is enabled, then an HDF5_${LANG}_HL_LIBRARIES will
+# also be defined. With all components enabled, the following variables will be defined:
+#
+# ::
+#
+# HDF5_C_LIBRARIES - Required libraries for the HDF5 C bindings
+# HDF5_CXX_LIBRARIES - Required libraries for the HDF5 C++ bindings
+# HDF5_Fortran_LIBRARIES - Required libraries for the HDF5 Fortran bindings
+# HDF5_C_HL_LIBRARIES - Required libraries for the high level C bindings
+# HDF5_CXX_HL_LIBRARIES - Required libraries for the high level C++ bindings
+# HDF5_Fortran_HL_LIBRARIES - Required libraries for the high level Fortran
+# bindings.
+#
+# HDF5_IS_PARALLEL - Whether or not HDF5 was found with parallel IO support
+# HDF5_C_COMPILER_EXECUTABLE - the path to the HDF5 C wrapper compiler
+# HDF5_CXX_COMPILER_EXECUTABLE - the path to the HDF5 C++ wrapper compiler
+# HDF5_Fortran_COMPILER_EXECUTABLE - the path to the HDF5 Fortran wrapper compiler
+# HDF5_C_COMPILER_EXECUTABLE_NO_INTERROGATE - path to the primary C compiler
+# which is also the HDF5 wrapper
+# HDF5_CXX_COMPILER_EXECUTABLE_NO_INTERROGATE - path to the primary C++
+# compiler which is also
+# the HDF5 wrapper
+# HDF5_Fortran_COMPILER_EXECUTABLE_NO_INTERROGATE - path to the primary
+# Fortran compiler which
+# is also the HDF5 wrapper
+# HDF5_DIFF_EXECUTABLE - the path to the HDF5 dataset comparison tool
+#
+# The following variable can be set to guide the search for HDF5 libraries and includes:
+#
+# HDF5_ROOT
+
+#=============================================================================
+# Copyright 2015 Axel Huebl, Helmholtz-Zentrum Dresden - Rossendorf
+# Copyright 2009 Kitware, Inc.
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+# License text for the above reference.)
+
+# This module is maintained by Will Dicharry <wdicharry at stellarscience.com>.
+
+include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+
+# List of the valid HDF5 components
+set(HDF5_VALID_LANGUAGE_BINDINGS C CXX Fortran)
+
+# Validate the list of find components.
+set(HDF5_LANGUAGE_BINDINGS)
+if(NOT HDF5_FIND_COMPONENTS)
+ get_property(__langs GLOBAL PROPERTY ENABLED_LANGUAGES)
+ foreach(__lang IN LISTS __langs)
+ if(__lang MATCHES "^(C|CXX|Fortran)$")
+ list(APPEND HDF5_LANGUAGE_BINDINGS ${__lang})
+ set(HDF5_FIND_REQUIRED_${__lang} True)
+ endif()
+ endforeach()
+ set(FIND_HL ON)
+ set(HDF5_FIND_REQUIRED_HL True)
+else()
+ # add the extra specified components, ensuring that they are valid.
+ set(FIND_HL OFF)
+ foreach(component IN LISTS HDF5_FIND_COMPONENTS)
+ list(FIND HDF5_VALID_LANGUAGE_BINDINGS ${component} component_location)
+ if(NOT component_location EQUAL -1)
+ list(APPEND HDF5_LANGUAGE_BINDINGS ${component})
+ elseif(component STREQUAL "HL")
+ set(FIND_HL ON)
+ elseif(component STREQUAL "Fortran_HL") # only for compatibility
+ list(APPEND HDF5_LANGUAGE_BINDINGS Fortran)
+ set(FIND_HL ON)
+ set(HDF5_FIND_REQUIRED_Fortran_HL False)
+ set(HDF5_FIND_REQUIRED_Fortran True)
+ set(HDF5_FIND_REQUIRED_HL True)
+ else()
+ message(FATAL_ERROR "${component} is not a valid HDF5 component.")
+ endif()
+ endforeach()
+ if(NOT HDF5_LANGUAGE_BINDINGS)
+ get_property(__langs GLOBAL PROPERTY ENABLED_LANGUAGES)
+ foreach(__lang IN LISTS __langs)
+ if(__lang MATCHES "^(C|CXX|Fortran)$")
+ list(APPEND HDF5_LANGUAGE_BINDINGS ${__lang})
+ endif()
+ endforeach()
+ endif()
+ list(REMOVE_ITEM HDF5_FIND_COMPONENTS Fortran_HL) # replaced by Fortran and HL
+ list(REMOVE_DUPLICATES HDF5_LANGUAGE_BINDINGS)
+endif()
+
+# Determine whether to search for serial or parallel executable first
+if(HDF5_PREFER_PARALLEL)
+ set(HDF5_C_COMPILER_NAMES h5pcc h5cc)
+ set(HDF5_CXX_COMPILER_NAMES h5pc++ h5c++)
+ set(HDF5_Fortran_COMPILER_NAMES h5pfc h5fc)
+else()
+ set(HDF5_C_COMPILER_NAMES h5cc h5pcc)
+ set(HDF5_CXX_COMPILER_NAMES h5c++ h5pc++)
+ set(HDF5_Fortran_COMPILER_NAMES h5fc h5pfc)
+endif()
+
+# We may have picked up some duplicates in various lists during the above
+# process for the language bindings (both the C and C++ bindings depend on
+# libz for example). Remove the duplicates. It appears that the default
+# CMake behavior is to remove duplicates from the end of a list. However,
+# for link lines, this is incorrect since unresolved symbols are searched
+# for down the link line. Therefore, we reverse the list, remove the
+# duplicates, and then reverse it again to get the duplicates removed from
+# the beginning.
+macro(_HDF5_remove_duplicates_from_beginning _list_name)
+ if(${_list_name})
+ list(REVERSE ${_list_name})
+ list(REMOVE_DUPLICATES ${_list_name})
+ list(REVERSE ${_list_name})
+ endif()
+endmacro()
+
+
+# Test first if the current compilers automatically wrap HDF5
+
+function(_HDF5_test_regular_compiler_C success version)
+ set(scratch_directory
+ ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/hdf5)
+ if(NOT ${success} OR
+ NOT EXISTS ${scratch_directory}/compiler_has_h5_c)
+ set(test_file ${scratch_directory}/cmake_hdf5_test.c)
+ file(WRITE ${test_file}
+ "#include <hdf5.h>\n"
+ "#include <hdf5_hl.h>\n"
+ "int main(void) {\n"
+ " char const* info_ver = \"INFO\" \":\" H5_VERSION;\n"
+ " hid_t fid;\n"
+ " fid = H5Fcreate(\"foo.h5\",H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT);\n"
+ " return 0;\n"
+ "}")
+ try_compile(${success} ${scratch_directory} ${test_file}
+ COPY_FILE ${scratch_directory}/compiler_has_h5_c
+ )
+ endif()
+ if(${success})
+ file(STRINGS ${scratch_directory}/compiler_has_h5_c INFO_VER
+ REGEX "^INFO:([0-9]+\\.[0-9]+\\.[0-9]+)(-patch([0-9]+))?"
+ )
+ string(REGEX MATCH "^INFO:([0-9]+\\.[0-9]+\\.[0-9]+)(-patch([0-9]+))?"
+ INFO_VER "${INFO_VER}"
+ )
+ set(${version} ${CMAKE_MATCH_1})
+ if(CMAKE_MATCH_3)
+ set(${version} ${HDF5_CXX_VERSION}.${CMAKE_MATCH_3})
+ endif()
+ set(${version} ${${version}} PARENT_SCOPE)
+ endif()
+endfunction()
+
+function(_HDF5_test_regular_compiler_CXX success version)
+ set(scratch_directory ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/hdf5)
+ if(NOT ${success} OR
+ NOT EXISTS ${scratch_directory}/compiler_has_h5_cxx)
+ set(test_file ${scratch_directory}/cmake_hdf5_test.cxx)
+ file(WRITE ${test_file}
+ "#include <H5Cpp.h>\n"
+ "#ifndef H5_NO_NAMESPACE\n"
+ "using namespace H5;\n"
+ "#endif\n"
+ "int main(int argc, char **argv) {\n"
+ " char const* info_ver = \"INFO\" \":\" H5_VERSION;\n"
+ " H5File file(\"foo.h5\", H5F_ACC_TRUNC);\n"
+ " return 0;\n"
+ "}")
+ try_compile(${success} ${scratch_directory} ${test_file}
+ COPY_FILE ${scratch_directory}/compiler_has_h5_cxx
+ )
+ endif()
+ if(${success})
+ file(STRINGS ${scratch_directory}/compiler_has_h5_cxx INFO_VER
+ REGEX "^INFO:([0-9]+\\.[0-9]+\\.[0-9]+)(-patch([0-9]+))?"
+ )
+ string(REGEX MATCH "^INFO:([0-9]+\\.[0-9]+\\.[0-9]+)(-patch([0-9]+))?"
+ INFO_VER "${INFO_VER}"
+ )
+ set(${version} ${CMAKE_MATCH_1})
+ if(CMAKE_MATCH_3)
+ set(${version} ${HDF5_CXX_VERSION}.${CMAKE_MATCH_3})
+ endif()
+ set(${version} ${${version}} PARENT_SCOPE)
+ endif()
+endfunction()
+
+function(_HDF5_test_regular_compiler_Fortran success)
+ if(NOT ${success})
+ set(scratch_directory
+ ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/hdf5)
+ set(test_file ${scratch_directory}/cmake_hdf5_test.f90)
+ file(WRITE ${test_file}
+ "program hdf5_hello\n"
+ " use hdf5\n"
+ " use h5lt\n"
+ " use h5ds\n"
+ " integer error\n"
+ " call h5open_f(error)\n"
+ " call h5close_f(error)\n"
+ "end\n")
+ try_compile(${success} ${scratch_directory} ${test_file})
+ endif()
+endfunction()
+
+# Invoke the HDF5 wrapper compiler. The compiler return value is stored to the
+# return_value argument, the text output is stored to the output variable.
+macro( _HDF5_invoke_compiler language output return_value version)
+ set(${version})
+ if(HDF5_USE_STATIC_LIBRARIES)
+ set(lib_type_args -noshlib)
+ else()
+ set(lib_type_args -shlib)
+ endif()
+ set(scratch_dir ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/hdf5)
+ if("${language}" STREQUAL "C")
+ set(test_file ${scratch_dir}/cmake_hdf5_test.c)
+ elseif("${language}" STREQUAL "CXX")
+ set(test_file ${scratch_dir}/cmake_hdf5_test.cxx)
+ elseif("${language}" STREQUAL "Fortran")
+ set(test_file ${scratch_dir}/cmake_hdf5_test.f90)
+ endif()
+ exec_program( ${HDF5_${language}_COMPILER_EXECUTABLE}
+ ARGS -show ${lib_type_args} ${test_file}
+ OUTPUT_VARIABLE ${output}
+ RETURN_VALUE ${return_value}
+ )
+ if(NOT ${${return_value}} EQUAL 0)
+ message(STATUS
+ "Unable to determine HDF5 ${language} flags from HDF5 wrapper.")
+ endif()
+ exec_program( ${HDF5_${language}_COMPILER_EXECUTABLE}
+ ARGS -showconfig
+ OUTPUT_VARIABLE config_output
+ RETURN_VALUE config_return
+ )
+ if(NOT ${return_value} EQUAL 0)
+ message( STATUS
+ "Unable to determine HDF5 ${language} version from HDF5 wrapper.")
+ endif()
+ string(REGEX MATCH "HDF5 Version: ([a-zA-Z0-9\\.\\-]*)" version_match "${config_output}")
+ if(version_match)
+ string(REPLACE "HDF5 Version: " "" ${version} "${version_match}")
+ string(REPLACE "-patch" "." ${version} "${${version}}")
+ endif()
+endmacro()
+
+# Parse a compile line for definitions, includes, library paths, and libraries.
+macro( _HDF5_parse_compile_line
+ compile_line_var
+ include_paths
+ definitions
+ library_paths
+ libraries
+ libraries_hl)
+
+ # Match the include paths
+ set( RE " -I *([^\" ]+|\"[^\"]+\")")
+ string( REGEX MATCHALL "${RE}" include_path_flags "${${compile_line_var}}")
+ foreach( IPATH IN LISTS include_path_flags )
+ string( REGEX REPLACE "${RE}" "\\1" IPATH "${IPATH}" )
+ list( APPEND ${include_paths} ${IPATH} )
+ endforeach()
+
+ # Match the definitions
+ set( RE " -D([^ ]*)")
+ string( REGEX MATCHALL "${RE}" definition_flags "${${compile_line_var}}" )
+ foreach( DEF IN LISTS definition_flags )
+ string( REGEX REPLACE "${RE}" "\\1" DEF "${DEF}" )
+ list( APPEND ${definitions} ${DEF} )
+ endforeach()
+
+ # Match the library paths
+ set( RE " -L *([^\" ]+|\"[^\"]+\")")
+ string( REGEX MATCHALL "${RE}" library_path_flags "${${compile_line_var}}")
+ foreach( LPATH IN LISTS library_path_flags )
+ string( REGEX REPLACE "${RE}" "\\1" LPATH "${LPATH}" )
+ list( APPEND ${library_paths} ${LPATH} )
+ endforeach()
+
+ # now search for the lib names specified in the compile line (match -l...)
+ # match only -l's preceded by a space or comma
+ set( RE " -l *([^\" ]+|\"[^\"]+\")")
+ string( REGEX MATCHALL "${RE}" library_name_flags "${${compile_line_var}}")
+ foreach( LNAME IN LISTS library_name_flags )
+ string( REGEX REPLACE "${RE}" "\\1" LNAME "${LNAME}" )
+ if(LNAME MATCHES ".*hl")
+ list(APPEND ${libraries_hl} ${LNAME})
+ else()
+ list(APPEND ${libraries} ${LNAME})
+ endif()
+ endforeach()
+
+ # now search for full library paths with no flags
+ set( RE " ([^\" ]+|\"[^\"]+\")")
+ string( REGEX MATCHALL "${RE}" library_name_noflags "${${compile_line_var}}")
+ foreach( LIB IN LISTS library_name_noflags )
+ string( REGEX REPLACE "${RE}" "\\1" LIB "${LIB}" )
+ get_filename_component(LIB "${LIB}" ABSOLUTE)
+ if(NOT EXISTS ${LIB} OR IS_DIRECTORY ${LIB})
+ continue()
+ endif()
+ get_filename_component(LPATH ${LIB} DIRECTORY)
+ get_filename_component(LNAME ${LIB} NAME_WE)
+ string( REGEX REPLACE "^lib" "" LNAME ${LNAME} )
+ list( APPEND ${library_paths} ${LPATH} )
+ if(LNAME MATCHES ".*hl")
+ list(APPEND ${libraries_hl} ${LNAME})
+ else()
+ list(APPEND ${libraries} ${LNAME})
+ endif()
+ endforeach()
+endmacro()
+
+if(NOT HDF5_ROOT)
+ set(HDF5_ROOT $ENV{HDF5_ROOT})
+endif()
+
+# Try to find HDF5 using an installed hdf5-config.cmake
+if(NOT HDF5_FOUND AND NOT HDF5_ROOT)
+ find_package(HDF5 QUIET NO_MODULE)
+ if( HDF5_FOUND)
+ set(HDF5_INCLUDE_DIRS ${HDF5_INCLUDE_DIR})
+ set(HDF5_LIBRARIES)
+ set(HDF5_C_TARGET hdf5)
+ set(HDF5_C_HL_TARGET hdf5_hl)
+ set(HDF5_CXX_TARGET hdf5_cpp)
+ set(HDF5_CXX_HL_TARGET hdf5_hl_cpp)
+ set(HDF5_Fortran_TARGET hdf5_fortran)
+ set(HDF5_Fortran_HL_TARGET hdf5_hl_fortran)
+ if(HDF5_USE_STATIC_LIBRARIES)
+ set(_suffix "-static")
+ else()
+ set(_suffix "-shared")
+ endif()
+ foreach(_lang ${HDF5_LANGUAGE_BINDINGS})
+
+ #Older versions of hdf5 don't have a static/shared suffix so
+ #if we detect that occurrence clear the suffix
+ if(_suffix AND NOT TARGET ${HDF5_${_lang}_TARGET}${_suffix})
+ if(NOT TARGET ${HDF5_${_lang}_TARGET})
+ #cant find this component with our without the suffix
+ #so bail out, and let the following locate HDF5
+ set(HDF5_FOUND FALSE)
+ break()
+ endif()
+ set(_suffix "")
+ endif()
+
+ get_target_property(_lang_location ${HDF5_${_lang}_TARGET}${_suffix} LOCATION)
+ if( _lang_location )
+ set(HDF5_${_lang}_LIBRARY ${_lang_location} CACHE PATH
+ "HDF5 ${_lang} library" )
+ mark_as_advanced(HDF5_${_lang}_LIBRARY)
+ list(APPEND HDF5_LIBRARIES ${HDF5_${_lang}_LIBRARY})
+ set(HDF5_${_lang}_LIBRARIES ${HDF5_${_lang}_LIBRARY})
+ set(HDF5_${_lang}_FOUND True)
+ endif()
+ if(FIND_HL)
+ get_target_property(_lang_hl_location ${HDF5_${_lang}_HL_TARGET}${_suffix} LOCATION)
+ if( _lang_hl_location )
+ set(HDF5_${_lang}_HL_LIBRARY ${_lang_hl_location} CACHE PATH
+ "HDF5 ${_lang} HL library" )
+ mark_as_advanced(HDF5_${_lang}_HL_LIBRARY)
+ list(APPEND HDF5_HL_LIBRARIES ${HDF5_${_lang}_HL_LIBRARY})
+ set(HDF5_${_lang}_HL_LIBRARIES ${HDF5_${_lang}_HL_LIBRARY})
+ set(HDF5_HL_FOUND True)
+ endif()
+ endif()
+ endforeach()
+ endif()
+endif()
+
+if(NOT HDF5_FOUND AND NOT HDF5_ROOT)
+ set(_HDF5_NEED_TO_SEARCH False)
+ set(HDF5_COMPILER_NO_INTERROGATE True)
+ # Only search for languages we've enabled
+ foreach(__lang IN LISTS HDF5_LANGUAGE_BINDINGS)
+ # First check to see if our regular compiler is one of wrappers
+ if(__lang STREQUAL "C")
+ _HDF5_test_regular_compiler_C(
+ HDF5_${__lang}_COMPILER_NO_INTERROGATE
+ HDF5_${__lang}_VERSION)
+ elseif(__lang STREQUAL "CXX")
+ _HDF5_test_regular_compiler_CXX(
+ HDF5_${__lang}_COMPILER_NO_INTERROGATE
+ HDF5_${__lang}_VERSION)
+ elseif(__lang STREQUAL "Fortran")
+ _HDF5_test_regular_compiler_Fortran(
+ HDF5_${__lang}_COMPILER_NO_INTERROGATE)
+ else()
+ continue()
+ endif()
+ if(HDF5_${__lang}_COMPILER_NO_INTERROGATE)
+ message(STATUS "HDF5: Using hdf5 compiler wrapper for all ${__lang} compiling")
+ set(HDF5_${__lang}_FOUND True)
+ set(HDF5_${__lang}_COMPILER_EXECUTABLE_NO_INTERROGATE
+ "${CMAKE_${__lang}_COMPILER}"
+ CACHE FILEPATH "HDF5 ${__lang} compiler wrapper")
+ set(HDF5_${__lang}_DEFINITIONS)
+ set(HDF5_${__lang}_INCLUDE_DIRS)
+ set(HDF5_${__lang}_LIBRARIES)
+ set(HDF5_${__lang}_HL_LIBRARIES)
+
+ mark_as_advanced(HDF5_${__lang}_COMPILER_EXECUTABLE_NO_INTERROGATE)
+ mark_as_advanced(HDF5_${__lang}_DEFINITIONS)
+ mark_as_advanced(HDF5_${__lang}_INCLUDE_DIRS)
+ mark_as_advanced(HDF5_${__lang}_LIBRARIES)
+ mark_as_advanced(HDF5_${__lang}_HL_LIBRARIES)
+
+ set(HDF5_${__lang}_FOUND True)
+ set(HDF5_HL_FOUND True)
+ else()
+ set(HDF5_COMPILER_NO_INTERROGATE False)
+ # If this language isn't using the wrapper, then try to seed the
+ # search options with the wrapper
+ find_program(HDF5_${__lang}_COMPILER_EXECUTABLE
+ NAMES ${HDF5_${__lang}_COMPILER_NAMES} NAMES_PER_DIR
+ PATH_SUFFIXES bin Bin
+ DOC "HDF5 ${__lang} Wrapper compiler. Used only to detect HDF5 compile flags."
+ )
+ mark_as_advanced( HDF5_${__lang}_COMPILER_EXECUTABLE )
+ unset(HDF5_${__lang}_COMPILER_NAMES)
+
+ if(HDF5_${__lang}_COMPILER_EXECUTABLE)
+ _HDF5_invoke_compiler(${__lang} HDF5_${__lang}_COMPILE_LINE
+ HDF5_${__lang}_RETURN_VALUE HDF5_${__lang}_VERSION)
+ if(HDF5_${__lang}_RETURN_VALUE EQUAL 0)
+ message(STATUS "HDF5: Using hdf5 compiler wrapper to determine ${__lang} configuration")
+ _HDF5_parse_compile_line( HDF5_${__lang}_COMPILE_LINE
+ HDF5_${__lang}_INCLUDE_DIRS
+ HDF5_${__lang}_DEFINITIONS
+ HDF5_${__lang}_LIBRARY_DIRS
+ HDF5_${__lang}_LIBRARY_NAMES
+ HDF5_${__lang}_HL_LIBRARY_NAMES
+ )
+ set(HDF5_${__lang}_LIBRARIES)
+
+ set(_HDF5_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
+ if(HDF5_USE_STATIC_LIBRARIES)
+ set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_STATIC_LIBRARY_SUFFIX})
+ else()
+ set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_SHARED_LIBRARY_SUFFIX})
+ endif()
+
+ foreach(L IN LISTS HDF5_${__lang}_LIBRARY_NAMES)
+ find_library(HDF5_${__lang}_LIBRARY_${L} ${L} ${HDF5_${__lang}_LIBRARY_DIRS})
+ if(HDF5_${__lang}_LIBRARY_${L})
+ list(APPEND HDF5_${__lang}_LIBRARIES ${HDF5_${__lang}_LIBRARY_${L}})
+ else()
+ list(APPEND HDF5_${__lang}_LIBRARIES ${L})
+ endif()
+ endforeach()
+ if(FIND_HL)
+ set(HDF5_${__lang}_HL_LIBRARIES)
+ foreach(L IN LISTS HDF5_${__lang}_HL_LIBRARY_NAMES)
+ find_library(HDF5_${__lang}_LIBRARY_${L} ${L} ${HDF5_${__lang}_LIBRARY_DIRS})
+ if(HDF5_${__lang}_LIBRARY_${L})
+ list(APPEND HDF5_${__lang}_HL_LIBRARIES ${HDF5_${__lang}_LIBRARY_${L}})
+ else()
+ list(APPEND HDF5_${__lang}_HL_LIBRARIES ${L})
+ endif()
+ endforeach()
+ set(HDF5_HL_FOUND True)
+ endif()
+
+ set(CMAKE_FIND_LIBRARY_SUFFIXES ${_HDF5_CMAKE_FIND_LIBRARY_SUFFIXES})
+
+ set(HDF5_${__lang}_FOUND True)
+ mark_as_advanced(HDF5_${__lang}_DEFINITIONS)
+ mark_as_advanced(HDF5_${__lang}_INCLUDE_DIRS)
+ mark_as_advanced(HDF5_${__lang}_LIBRARIES)
+ _HDF5_remove_duplicates_from_beginning(HDF5_${__lang}_DEFINITIONS)
+ _HDF5_remove_duplicates_from_beginning(HDF5_${__lang}_INCLUDE_DIRS)
+ _HDF5_remove_duplicates_from_beginning(HDF5_${__lang}_LIBRARIES)
+ _HDF5_remove_duplicates_from_beginning(HDF5_${__lang}_HL_LIBRARIES)
+ else()
+ set(_HDF5_NEED_TO_SEARCH True)
+ endif()
+ else()
+ set(_HDF5_NEED_TO_SEARCH True)
+ endif()
+ endif()
+ if(HDF5_${__lang}_VERSION)
+ if(NOT HDF5_VERSION)
+ set(HDF5_VERSION ${HDF5_${__lang}_VERSION})
+ elseif(NOT HDF5_VERSION VERSION_EQUAL HDF5_${__lang}_VERSION)
+ message(WARNING "HDF5 Version found for language ${__lang}, ${HDF5_${__lang}_VERSION} is different than previously found version ${HDF5_VERSION}")
+ endif()
+ endif()
+ endforeach()
+else()
+ set(_HDF5_NEED_TO_SEARCH True)
+endif()
+
+if(NOT HDF5_FOUND AND HDF5_COMPILER_NO_INTERROGATE)
+ # No arguments necessary, all languages can use the compiler wrappers
+ set(HDF5_FOUND True)
+ set(HDF5_METHOD "Included by compiler wrappers")
+ set(HDF5_REQUIRED_VARS HDF5_METHOD)
+elseif(NOT HDF5_FOUND AND NOT _HDF5_NEED_TO_SEARCH)
+ # Compiler wrappers aren't being used by the build but were found and used
+ # to determine necessary include and library flags
+ set(HDF5_INCLUDE_DIRS)
+ set(HDF5_LIBRARIES)
+ set(HDF5_HL_LIBRARIES)
+ foreach(__lang IN LISTS HDF5_LANGUAGE_BINDINGS)
+ if(HDF5_${__lang}_FOUND)
+ if(NOT HDF5_${__lang}_COMPILER_NO_INTERROGATE)
+ list(APPEND HDF5_DEFINITIONS ${HDF5_${__lang}_DEFINITIONS})
+ list(APPEND HDF5_INCLUDE_DIRS ${HDF5_${__lang}_INCLUDE_DIRS})
+ list(APPEND HDF5_LIBRARIES ${HDF5_${__lang}_LIBRARIES})
+ if(FIND_HL)
+ list(APPEND HDF5_HL_LIBRARIES ${HDF5_${__lang}_HL_LIBRARIES})
+ endif()
+ endif()
+ endif()
+ endforeach()
+ _HDF5_remove_duplicates_from_beginning(HDF5_DEFINITIONS)
+ _HDF5_remove_duplicates_from_beginning(HDF5_INCLUDE_DIRS)
+ _HDF5_remove_duplicates_from_beginning(HDF5_LIBRARIES)
+ _HDF5_remove_duplicates_from_beginning(HDF5_HL_LIBRARIES)
+ set(HDF5_FOUND True)
+ set(HDF5_REQUIRED_VARS HDF5_LIBRARIES)
+ if(FIND_HL)
+ list(APPEND HDF5_REQUIRED_VARS HDF5_HL_LIBRARIES)
+ endif()
+endif()
+
+if(HDF5_ROOT)
+ set(SEARCH_OPTS NO_DEFAULT_PATH)
+endif()
+find_program( HDF5_DIFF_EXECUTABLE
+ NAMES h5diff
+ HINTS ${HDF5_ROOT}
+ PATH_SUFFIXES bin Bin
+ ${SEARCH_OPTS}
+ DOC "HDF5 file differencing tool." )
+mark_as_advanced( HDF5_DIFF_EXECUTABLE )
+
+if( NOT HDF5_FOUND )
+ # seed the initial lists of libraries to find with items we know we need
+ set(HDF5_C_LIBRARY_NAMES hdf5)
+ set(HDF5_C_HL_LIBRARY_NAMES hdf5_hl)
+
+ set(HDF5_CXX_LIBRARY_NAMES hdf5_cpp ${HDF5_C_LIBRARY_NAMES})
+ set(HDF5_CXX_HL_LIBRARY_NAMES hdf5_hl_cpp ${HDF5_C_HL_LIBRARY_NAMES} ${HDF5_CXX_LIBRARY_NAMES})
+
+ set(HDF5_Fortran_LIBRARY_NAMES hdf5_fortran ${HDF5_C_LIBRARY_NAMES})
+ set(HDF5_Fortran_HL_LIBRARY_NAMES hdf5_hl_fortran ${HDF5_C_HL_LIBRARY_NAMES} ${HDF5_Fortran_LIBRARY_NAMES})
+
+ foreach(__lang IN LISTS HDF5_LANGUAGE_BINDINGS)
+ # find the HDF5 include directories
+ if(LANGUAGE STREQUAL "Fortran")
+ set(HDF5_INCLUDE_FILENAME hdf5.mod)
+ elseif(LANGUAGE STREQUAL "CXX")
+ set(HDF5_INCLUDE_FILENAME H5Cpp.h)
+ else()
+ set(HDF5_INCLUDE_FILENAME hdf5.h)
+ endif()
+
+ find_path(HDF5_${__lang}_INCLUDE_DIR ${HDF5_INCLUDE_FILENAME}
+ HINTS ${HDF5_ROOT}
+ PATHS $ENV{HOME}/.local/include
+ PATH_SUFFIXES include Include
+ ${SEARCH_OPTS}
+ )
+ mark_as_advanced(HDF5_${LANGUAGE}_INCLUDE_DIR)
+ list(APPEND HDF5_INCLUDE_DIRS ${HDF5_${__lang}_INCLUDE_DIR})
+
+ # find the HDF5 libraries
+ foreach(LIB IN LISTS HDF5_${__lang}_LIBRARY_NAMES)
+ if(UNIX AND HDF5_USE_STATIC_LIBRARIES)
+ # According to bug 1643 on the CMake bug tracker, this is the
+ # preferred method for searching for a static library.
+ # See https://cmake.org/Bug/view.php?id=1643. We search
+ # first for the full static library name, but fall back to a
+ # generic search on the name if the static search fails.
+ set( THIS_LIBRARY_SEARCH_DEBUG
+ lib${LIB}d.a lib${LIB}_debug.a ${LIB}d ${LIB}_debug
+ lib${LIB}d-static.a lib${LIB}_debug-static.a ${LIB}d-static ${LIB}_debug-static )
+ set( THIS_LIBRARY_SEARCH_RELEASE lib${LIB}.a ${LIB} lib${LIB}-static.a ${LIB}-static)
+ else()
+ set( THIS_LIBRARY_SEARCH_DEBUG ${LIB}d ${LIB}_debug ${LIB}d-shared ${LIB}_debug-shared)
+ set( THIS_LIBRARY_SEARCH_RELEASE ${LIB} ${LIB}-shared)
+ endif()
+ find_library(HDF5_${LIB}_LIBRARY_DEBUG
+ NAMES ${THIS_LIBRARY_SEARCH_DEBUG}
+ HINTS ${HDF5_ROOT} PATH_SUFFIXES lib Lib
+ ${SEARCH_OPTS}
+ )
+ find_library( HDF5_${LIB}_LIBRARY_RELEASE
+ NAMES ${THIS_LIBRARY_SEARCH_RELEASE}
+ HINTS ${HDF5_ROOT} PATH_SUFFIXES lib Lib
+ ${SEARCH_OPTS}
+ )
+ select_library_configurations( HDF5_${LIB} )
+ list(APPEND HDF5_${__lang}_LIBRARIES ${HDF5_${LIB}_LIBRARY})
+ endforeach()
+ if(HDF5_${__lang}_LIBRARIES)
+ set(HDF5_${__lang}_FOUND True)
+ endif()
+
+ # Append the libraries for this language binding to the list of all
+ # required libraries.
+ list(APPEND HDF5_LIBRARIES ${HDF5_${__lang}_LIBRARIES})
+
+ if(FIND_HL)
+ foreach(LIB IN LISTS HDF5_${__lang}_HL_LIBRARY_NAMES)
+ if(UNIX AND HDF5_USE_STATIC_LIBRARIES)
+ # According to bug 1643 on the CMake bug tracker, this is the
+ # preferred method for searching for a static library.
+ # See https://cmake.org/Bug/view.php?id=1643. We search
+ # first for the full static library name, but fall back to a
+ # generic search on the name if the static search fails.
+ set( THIS_LIBRARY_SEARCH_DEBUG
+ lib${LIB}d.a lib${LIB}_debug.a ${LIB}d ${LIB}_debug
+ lib${LIB}d-static.a lib${LIB}_debug-static.a ${LIB}d-static ${LIB}_debug-static )
+ set( THIS_LIBRARY_SEARCH_RELEASE lib${LIB}.a ${LIB} lib${LIB}-static.a ${LIB}-static)
+ else()
+ set( THIS_LIBRARY_SEARCH_DEBUG ${LIB}d ${LIB}_debug ${LIB}d-shared ${LIB}_debug-shared)
+ set( THIS_LIBRARY_SEARCH_RELEASE ${LIB} ${LIB}-shared)
+ endif()
+ find_library(HDF5_${LIB}_LIBRARY_DEBUG
+ NAMES ${THIS_LIBRARY_SEARCH_DEBUG}
+ HINTS ${HDF5_ROOT} PATH_SUFFIXES lib Lib
+ ${SEARCH_OPTS}
+ )
+ find_library( HDF5_${LIB}_LIBRARY_RELEASE
+ NAMES ${THIS_LIBRARY_SEARCH_RELEASE}
+ HINTS ${HDF5_ROOT} PATH_SUFFIXES lib Lib
+ ${SEARCH_OPTS}
+ )
+ select_library_configurations( HDF5_${LIB} )
+ list(APPEND HDF5_${__lang}_HL_LIBRARIES ${HDF5_${LIB}_LIBRARY})
+ endforeach()
+
+ # Append the libraries for this language binding to the list of all
+ # required libraries.
+ list(APPEND HDF5_HL_LIBRARIES ${HDF5_${__lang}_HL_LIBRARIES})
+ endif()
+ endforeach()
+ if(FIND_HL AND HDF5_HL_LIBRARIES)
+ set(HDF5_HL_FOUND True)
+ endif()
+
+ _HDF5_remove_duplicates_from_beginning(HDF5_INCLUDE_DIRS)
+ _HDF5_remove_duplicates_from_beginning(HDF5_LIBRARIES)
+ _HDF5_remove_duplicates_from_beginning(HDF5_HL_LIBRARIES)
+
+ # If the HDF5 include directory was found, open H5pubconf.h to determine if
+ # HDF5 was compiled with parallel IO support
+ set( HDF5_IS_PARALLEL FALSE )
+ set( HDF5_VERSION "" )
+ foreach( _dir IN LISTS HDF5_INCLUDE_DIRS )
+ foreach(_hdr "${_dir}/H5pubconf.h" "${_dir}/H5pubconf-64.h" "${_dir}/H5pubconf-32.h")
+ if( EXISTS "${_hdr}" )
+ file( STRINGS "${_hdr}"
+ HDF5_HAVE_PARALLEL_DEFINE
+ REGEX "HAVE_PARALLEL 1" )
+ if( HDF5_HAVE_PARALLEL_DEFINE )
+ set( HDF5_IS_PARALLEL TRUE )
+ endif()
+ unset(HDF5_HAVE_PARALLEL_DEFINE)
+
+ file( STRINGS "${_hdr}"
+ HDF5_VERSION_DEFINE
+ REGEX "^[ \t]*#[ \t]*define[ \t]+H5_VERSION[ \t]+" )
+ if( "${HDF5_VERSION_DEFINE}" MATCHES
+ "H5_VERSION[ \t]+\"([0-9]+\\.[0-9]+\\.[0-9]+)(-patch([0-9]+))?\"" )
+ set( HDF5_VERSION "${CMAKE_MATCH_1}" )
+ if( CMAKE_MATCH_3 )
+ set( HDF5_VERSION ${HDF5_VERSION}.${CMAKE_MATCH_3})
+ endif()
+ endif()
+ unset(HDF5_VERSION_DEFINE)
+ endif()
+ endforeach()
+ endforeach()
+ set( HDF5_IS_PARALLEL ${HDF5_IS_PARALLEL} CACHE BOOL
+ "HDF5 library compiled with parallel IO support" )
+ mark_as_advanced( HDF5_IS_PARALLEL )
+
+ # For backwards compatibility we set HDF5_INCLUDE_DIR to the value of
+ # HDF5_INCLUDE_DIRS
+ if( HDF5_INCLUDE_DIRS )
+ set( HDF5_INCLUDE_DIR "${HDF5_INCLUDE_DIRS}" )
+ endif()
+ set(HDF5_REQUIRED_VARS HDF5_LIBRARIES HDF5_INCLUDE_DIRS)
+ if(FIND_HL)
+ list(APPEND HDF5_REQUIRED_VARS HDF5_HL_LIBRARIES)
+ endif()
+endif()
+
+# If HDF5_REQUIRED_VARS is empty at this point, then it's likely that
+# something external is trying to explicitly pass already found
+# locations
+if(NOT HDF5_REQUIRED_VARS)
+ set(HDF5_REQUIRED_VARS HDF5_LIBRARIES HDF5_INCLUDE_DIRS)
+endif()
+
+find_package_handle_standard_args(HDF5
+ REQUIRED_VARS ${HDF5_REQUIRED_VARS}
+ VERSION_VAR HDF5_VERSION
+ HANDLE_COMPONENTS
+)
diff --git a/VTK/CMake/NewCMake/FindPackageHandleStandardArgs.cmake b/VTK/CMake/NewCMake/FindPackageHandleStandardArgs.cmake
new file mode 100644
index 0000000..fe2dbea
--- /dev/null
+++ b/VTK/CMake/NewCMake/FindPackageHandleStandardArgs.cmake
@@ -0,0 +1,396 @@
+#[=======================================================================[.rst:
+FindPackageHandleStandardArgs
+-----------------------------
+
+This module provides a function intended to be used in :ref:`Find Modules`
+implementing :command:`find_package(<PackageName>)` calls. It handles the
+``REQUIRED``, ``QUIET`` and version-related arguments of ``find_package``.
+It also sets the ``<PackageName>_FOUND`` variable. The package is
+considered found if all variables listed contain valid results, e.g.
+valid filepaths.
+
+.. command:: find_package_handle_standard_args
+
+ There are two signatures::
+
+ find_package_handle_standard_args(<PackageName>
+ (DEFAULT_MSG|<custom-failure-message>)
+ <required-var>...
+ )
+
+ find_package_handle_standard_args(<PackageName>
+ [FOUND_VAR <result-var>]
+ [REQUIRED_VARS <required-var>...]
+ [VERSION_VAR <version-var>]
+ [HANDLE_COMPONENTS]
+ [CONFIG_MODE]
+ [FAIL_MESSAGE <custom-failure-message>]
+ )
+
+ The ``<PackageName>_FOUND`` variable will be set to ``TRUE`` if all
+ the variables ``<required-var>...`` are valid and any optional
+ constraints are satisfied, and ``FALSE`` otherwise. A success or
+ failure message may be displayed based on the results and on
+ whether the ``REQUIRED`` and/or ``QUIET`` option was given to
+ the :command:`find_package` call.
+
+ The options are:
+
+ ``(DEFAULT_MSG|<custom-failure-message>)``
+ In the simple signature this specifies the failure message.
+ Use ``DEFAULT_MSG`` to ask for a default message to be computed
+ (recommended). Not valid in the full signature.
+
+ ``FOUND_VAR <result-var>``
+ Obsolete. Specifies either ``<PackageName>_FOUND`` or
+ ``<PACKAGENAME>_FOUND`` as the result variable. This exists only
+ for compatibility with older versions of CMake and is now ignored.
+ Result variables of both names are always set for compatibility.
+
+ ``REQUIRED_VARS <required-var>...``
+ Specify the variables which are required for this package.
+ These may be named in the generated failure message asking the
+ user to set the missing variable values. Therefore these should
+ typically be cache entries such as ``FOO_LIBRARY`` and not output
+ variables like ``FOO_LIBRARIES``.
+
+ ``VERSION_VAR <version-var>``
+ Specify the name of a variable that holds the version of the package
+ that has been found. This version will be checked against the
+ (potentially) specified required version given to the
+ :command:`find_package` call, including its ``EXACT`` option.
+ The default messages include information about the required
+ version and the version which has been actually found, both
+ if the version is ok or not.
+
+ ``HANDLE_COMPONENTS``
+ Enable handling of package components. In this case, the command
+ will report which components have been found and which are missing,
+ and the ``<PackageName>_FOUND`` variable will be set to ``FALSE``
+ if any of the required components (i.e. not the ones listed after
+ the ``OPTIONAL_COMPONENTS`` option of :command:`find_package`) are
+ missing.
+
+ ``CONFIG_MODE``
+ Specify that the calling find module is a wrapper around a
+ call to ``find_package(<PackageName> NO_MODULE)``. This implies
+ a ``VERSION_VAR`` value of ``<PackageName>_VERSION``. The command
+ will automatically check whether the package configuration file
+ was found.
+
+ ``FAIL_MESSAGE <custom-failure-message>``
+ Specify a custom failure message instead of using the default
+ generated message. Not recommended.
+
+Example for the simple signature:
+
+.. code-block:: cmake
+
+ find_package_handle_standard_args(LibXml2 DEFAULT_MSG
+ LIBXML2_LIBRARY LIBXML2_INCLUDE_DIR)
+
+The ``LibXml2`` package is considered to be found if both
+``LIBXML2_LIBRARY`` and ``LIBXML2_INCLUDE_DIR`` are valid.
+Then also ``LibXml2_FOUND`` is set to ``TRUE``. If it is not found
+and ``REQUIRED`` was used, it fails with a
+:command:`message(FATAL_ERROR)`, independent whether ``QUIET`` was
+used or not. If it is found, success will be reported, including
+the content of the first ``<required-var>``. On repeated CMake runs,
+the same message will not be printed again.
+
+Example for the full signature:
+
+.. code-block:: cmake
+
+ find_package_handle_standard_args(LibArchive
+ REQUIRED_VARS LibArchive_LIBRARY LibArchive_INCLUDE_DIR
+ VERSION_VAR LibArchive_VERSION)
+
+In this case, the ``LibArchive`` package is considered to be found if
+both ``LibArchive_LIBRARY`` and ``LibArchive_INCLUDE_DIR`` are valid.
+Also the version of ``LibArchive`` will be checked by using the version
+contained in ``LibArchive_VERSION``. Since no ``FAIL_MESSAGE`` is given,
+the default messages will be printed.
+
+Another example for the full signature:
+
+.. code-block:: cmake
+
+ find_package(Automoc4 QUIET NO_MODULE HINTS /opt/automoc4)
+ find_package_handle_standard_args(Automoc4 CONFIG_MODE)
+
+In this case, a ``FindAutmoc4.cmake`` module wraps a call to
+``find_package(Automoc4 NO_MODULE)`` and adds an additional search
+directory for ``automoc4``. Then the call to
+``find_package_handle_standard_args`` produces a proper success/failure
+message.
+#]=======================================================================]
+
+#=============================================================================
+# Copyright 2007-2009 Kitware, Inc.
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+# License text for the above reference.)
+
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageMessage.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/CMakeParseArguments.cmake)
+
+# internal helper macro
+macro(_FPHSA_FAILURE_MESSAGE _msg)
+ if (${_NAME}_FIND_REQUIRED)
+ message(FATAL_ERROR "${_msg}")
+ else ()
+ if (NOT ${_NAME}_FIND_QUIETLY)
+ message(STATUS "${_msg}")
+ endif ()
+ endif ()
+endmacro()
+
+
+# internal helper macro to generate the failure message when used in CONFIG_MODE:
+macro(_FPHSA_HANDLE_FAILURE_CONFIG_MODE)
+ # <name>_CONFIG is set, but FOUND is false, this means that some other of the REQUIRED_VARS was not found:
+ if(${_NAME}_CONFIG)
+ _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: missing: ${MISSING_VARS} (found ${${_NAME}_CONFIG} ${VERSION_MSG})")
+ else()
+ # If _CONSIDERED_CONFIGS is set, the config-file has been found, but no suitable version.
+ # List them all in the error message:
+ if(${_NAME}_CONSIDERED_CONFIGS)
+ set(configsText "")
+ list(LENGTH ${_NAME}_CONSIDERED_CONFIGS configsCount)
+ math(EXPR configsCount "${configsCount} - 1")
+ foreach(currentConfigIndex RANGE ${configsCount})
+ list(GET ${_NAME}_CONSIDERED_CONFIGS ${currentConfigIndex} filename)
+ list(GET ${_NAME}_CONSIDERED_VERSIONS ${currentConfigIndex} version)
+ set(configsText "${configsText} ${filename} (version ${version})\n")
+ endforeach()
+ if (${_NAME}_NOT_FOUND_MESSAGE)
+ set(configsText "${configsText} Reason given by package: ${${_NAME}_NOT_FOUND_MESSAGE}\n")
+ endif()
+ _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE} ${VERSION_MSG}, checked the following files:\n${configsText}")
+
+ else()
+ # Simple case: No Config-file was found at all:
+ _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: found neither ${_NAME}Config.cmake nor ${_NAME_LOWER}-config.cmake ${VERSION_MSG}")
+ endif()
+ endif()
+endmacro()
+
+
+function(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG)
+
+# set up the arguments for CMAKE_PARSE_ARGUMENTS and check whether we are in
+# new extended or in the "old" mode:
+ set(options CONFIG_MODE HANDLE_COMPONENTS)
+ set(oneValueArgs FAIL_MESSAGE VERSION_VAR FOUND_VAR)
+ set(multiValueArgs REQUIRED_VARS)
+ set(_KEYWORDS_FOR_EXTENDED_MODE ${options} ${oneValueArgs} ${multiValueArgs} )
+ list(FIND _KEYWORDS_FOR_EXTENDED_MODE "${_FIRST_ARG}" INDEX)
+
+ if(${INDEX} EQUAL -1)
+ set(FPHSA_FAIL_MESSAGE ${_FIRST_ARG})
+ set(FPHSA_REQUIRED_VARS ${ARGN})
+ set(FPHSA_VERSION_VAR)
+ else()
+
+ CMAKE_PARSE_ARGUMENTS(FPHSA "${options}" "${oneValueArgs}" "${multiValueArgs}" ${_FIRST_ARG} ${ARGN})
+
+ if(FPHSA_UNPARSED_ARGUMENTS)
+ message(FATAL_ERROR "Unknown keywords given to FIND_PACKAGE_HANDLE_STANDARD_ARGS(): \"${FPHSA_UNPARSED_ARGUMENTS}\"")
+ endif()
+
+ if(NOT FPHSA_FAIL_MESSAGE)
+ set(FPHSA_FAIL_MESSAGE "DEFAULT_MSG")
+ endif()
+ endif()
+
+# now that we collected all arguments, process them
+
+ if("x${FPHSA_FAIL_MESSAGE}" STREQUAL "xDEFAULT_MSG")
+ set(FPHSA_FAIL_MESSAGE "Could NOT find ${_NAME}")
+ endif()
+
+ # In config-mode, we rely on the variable <package>_CONFIG, which is set by find_package()
+ # when it successfully found the config-file, including version checking:
+ if(FPHSA_CONFIG_MODE)
+ list(INSERT FPHSA_REQUIRED_VARS 0 ${_NAME}_CONFIG)
+ list(REMOVE_DUPLICATES FPHSA_REQUIRED_VARS)
+ set(FPHSA_VERSION_VAR ${_NAME}_VERSION)
+ endif()
+
+ if(NOT FPHSA_REQUIRED_VARS)
+ message(FATAL_ERROR "No REQUIRED_VARS specified for FIND_PACKAGE_HANDLE_STANDARD_ARGS()")
+ endif()
+
+ list(GET FPHSA_REQUIRED_VARS 0 _FIRST_REQUIRED_VAR)
+
+ string(TOUPPER ${_NAME} _NAME_UPPER)
+ string(TOLOWER ${_NAME} _NAME_LOWER)
+
+ if(FPHSA_FOUND_VAR)
+ if(FPHSA_FOUND_VAR MATCHES "^${_NAME}_FOUND$" OR FPHSA_FOUND_VAR MATCHES "^${_NAME_UPPER}_FOUND$")
+ set(_FOUND_VAR ${FPHSA_FOUND_VAR})
+ else()
+ message(FATAL_ERROR "The argument for FOUND_VAR is \"${FPHSA_FOUND_VAR}\", but only \"${_NAME}_FOUND\" and \"${_NAME_UPPER}_FOUND\" are valid names.")
+ endif()
+ else()
+ set(_FOUND_VAR ${_NAME_UPPER}_FOUND)
+ endif()
+
+ # collect all variables which were not found, so they can be printed, so the
+ # user knows better what went wrong (#6375)
+ set(MISSING_VARS "")
+ set(DETAILS "")
+ # check if all passed variables are valid
+ set(FPHSA_FOUND_${_NAME} TRUE)
+ foreach(_CURRENT_VAR ${FPHSA_REQUIRED_VARS})
+ if(NOT ${_CURRENT_VAR})
+ set(FPHSA_FOUND_${_NAME} FALSE)
+ set(MISSING_VARS "${MISSING_VARS} ${_CURRENT_VAR}")
+ else()
+ set(DETAILS "${DETAILS}[${${_CURRENT_VAR}}]")
+ endif()
+ endforeach()
+ if(FPHSA_FOUND_${_NAME})
+ set(${_NAME}_FOUND TRUE)
+ set(${_NAME_UPPER}_FOUND TRUE)
+ else()
+ set(${_NAME}_FOUND FALSE)
+ set(${_NAME_UPPER}_FOUND FALSE)
+ endif()
+
+ # component handling
+ unset(FOUND_COMPONENTS_MSG)
+ unset(MISSING_COMPONENTS_MSG)
+
+ if(FPHSA_HANDLE_COMPONENTS)
+ foreach(comp ${${_NAME}_FIND_COMPONENTS})
+ if(${_NAME}_${comp}_FOUND)
+
+ if(NOT DEFINED FOUND_COMPONENTS_MSG)
+ set(FOUND_COMPONENTS_MSG "found components: ")
+ endif()
+ set(FOUND_COMPONENTS_MSG "${FOUND_COMPONENTS_MSG} ${comp}")
+
+ else()
+
+ if(NOT DEFINED MISSING_COMPONENTS_MSG)
+ set(MISSING_COMPONENTS_MSG "missing components: ")
+ endif()
+ set(MISSING_COMPONENTS_MSG "${MISSING_COMPONENTS_MSG} ${comp}")
+
+ if(${_NAME}_FIND_REQUIRED_${comp})
+ set(${_NAME}_FOUND FALSE)
+ set(MISSING_VARS "${MISSING_VARS} ${comp}")
+ endif()
+
+ endif()
+ endforeach()
+ set(COMPONENT_MSG "${FOUND_COMPONENTS_MSG} ${MISSING_COMPONENTS_MSG}")
+ set(DETAILS "${DETAILS}[c${COMPONENT_MSG}]")
+ endif()
+
+ # version handling:
+ set(VERSION_MSG "")
+ set(VERSION_OK TRUE)
+ set(VERSION ${${FPHSA_VERSION_VAR}})
+
+ # check with DEFINED here as the requested or found version may be "0"
+ if (DEFINED ${_NAME}_FIND_VERSION)
+ if(DEFINED ${FPHSA_VERSION_VAR})
+
+ if(${_NAME}_FIND_VERSION_EXACT) # exact version required
+ # count the dots in the version string
+ string(REGEX REPLACE "[^.]" "" _VERSION_DOTS "${VERSION}")
+ # add one dot because there is one dot more than there are components
+ string(LENGTH "${_VERSION_DOTS}." _VERSION_DOTS)
+ if (_VERSION_DOTS GREATER ${_NAME}_FIND_VERSION_COUNT)
+ # Because of the C++ implementation of find_package() ${_NAME}_FIND_VERSION_COUNT
+ # is at most 4 here. Therefore a simple lookup table is used.
+ if (${_NAME}_FIND_VERSION_COUNT EQUAL 1)
+ set(_VERSION_REGEX "[^.]*")
+ elseif (${_NAME}_FIND_VERSION_COUNT EQUAL 2)
+ set(_VERSION_REGEX "[^.]*\\.[^.]*")
+ elseif (${_NAME}_FIND_VERSION_COUNT EQUAL 3)
+ set(_VERSION_REGEX "[^.]*\\.[^.]*\\.[^.]*")
+ else ()
+ set(_VERSION_REGEX "[^.]*\\.[^.]*\\.[^.]*\\.[^.]*")
+ endif ()
+ string(REGEX REPLACE "^(${_VERSION_REGEX})\\..*" "\\1" _VERSION_HEAD "${VERSION}")
+ unset(_VERSION_REGEX)
+ if (NOT ${_NAME}_FIND_VERSION VERSION_EQUAL _VERSION_HEAD)
+ set(VERSION_MSG "Found unsuitable version \"${VERSION}\", but required is exact version \"${${_NAME}_FIND_VERSION}\"")
+ set(VERSION_OK FALSE)
+ else ()
+ set(VERSION_MSG "(found suitable exact version \"${VERSION}\")")
+ endif ()
+ unset(_VERSION_HEAD)
+ else ()
+ if (NOT ${_NAME}_FIND_VERSION VERSION_EQUAL VERSION)
+ set(VERSION_MSG "Found unsuitable version \"${VERSION}\", but required is exact version \"${${_NAME}_FIND_VERSION}\"")
+ set(VERSION_OK FALSE)
+ else ()
+ set(VERSION_MSG "(found suitable exact version \"${VERSION}\")")
+ endif ()
+ endif ()
+ unset(_VERSION_DOTS)
+
+ else() # minimum version specified:
+ if (${_NAME}_FIND_VERSION VERSION_GREATER VERSION)
+ set(VERSION_MSG "Found unsuitable version \"${VERSION}\", but required is at least \"${${_NAME}_FIND_VERSION}\"")
+ set(VERSION_OK FALSE)
+ else ()
+ set(VERSION_MSG "(found suitable version \"${VERSION}\", minimum required is \"${${_NAME}_FIND_VERSION}\")")
+ endif ()
+ endif()
+
+ else()
+
+ # if the package was not found, but a version was given, add that to the output:
+ if(${_NAME}_FIND_VERSION_EXACT)
+ set(VERSION_MSG "(Required is exact version \"${${_NAME}_FIND_VERSION}\")")
+ else()
+ set(VERSION_MSG "(Required is at least version \"${${_NAME}_FIND_VERSION}\")")
+ endif()
+
+ endif()
+ else ()
+ if(VERSION)
+ set(VERSION_MSG "(found version \"${VERSION}\")")
+ endif()
+ endif ()
+
+ if(VERSION_OK)
+ set(DETAILS "${DETAILS}[v${VERSION}(${${_NAME}_FIND_VERSION})]")
+ else()
+ set(${_NAME}_FOUND FALSE)
+ endif()
+
+
+ # print the result:
+ if (${_NAME}_FOUND)
+ FIND_PACKAGE_MESSAGE(${_NAME} "Found ${_NAME}: ${${_FIRST_REQUIRED_VAR}} ${VERSION_MSG} ${COMPONENT_MSG}" "${DETAILS}")
+ else ()
+
+ if(FPHSA_CONFIG_MODE)
+ _FPHSA_HANDLE_FAILURE_CONFIG_MODE()
+ else()
+ if(NOT VERSION_OK)
+ _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: ${VERSION_MSG} (found ${${_FIRST_REQUIRED_VAR}})")
+ else()
+ _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE} (missing: ${MISSING_VARS}) ${VERSION_MSG}")
+ endif()
+ endif()
+
+ endif ()
+
+ set(${_NAME}_FOUND ${${_NAME}_FOUND} PARENT_SCOPE)
+ set(${_NAME_UPPER}_FOUND ${${_NAME}_FOUND} PARENT_SCOPE)
+endfunction()
diff --git a/VTK/CMake/NewCMake/FindPackageMessage.cmake b/VTK/CMake/NewCMake/FindPackageMessage.cmake
new file mode 100644
index 0000000..a0349d3
--- /dev/null
+++ b/VTK/CMake/NewCMake/FindPackageMessage.cmake
@@ -0,0 +1,57 @@
+#.rst:
+# FindPackageMessage
+# ------------------
+#
+#
+#
+# FIND_PACKAGE_MESSAGE(<name> "message for user" "find result details")
+#
+# This macro is intended to be used in FindXXX.cmake modules files. It
+# will print a message once for each unique find result. This is useful
+# for telling the user where a package was found. The first argument
+# specifies the name (XXX) of the package. The second argument
+# specifies the message to display. The third argument lists details
+# about the find result so that if they change the message will be
+# displayed again. The macro also obeys the QUIET argument to the
+# find_package command.
+#
+# Example:
+#
+# ::
+#
+# if(X11_FOUND)
+# FIND_PACKAGE_MESSAGE(X11 "Found X11: ${X11_X11_LIB}"
+# "[${X11_X11_LIB}][${X11_INCLUDE_DIR}]")
+# else()
+# ...
+# endif()
+
+#=============================================================================
+# Copyright 2008-2009 Kitware, Inc.
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+# License text for the above reference.)
+
+function(FIND_PACKAGE_MESSAGE pkg msg details)
+ # Avoid printing a message repeatedly for the same find result.
+ if(NOT ${pkg}_FIND_QUIETLY)
+ string(REPLACE "\n" "" details "${details}")
+ set(DETAILS_VAR FIND_PACKAGE_MESSAGE_DETAILS_${pkg})
+ if(NOT "${details}" STREQUAL "${${DETAILS_VAR}}")
+ # The message has not yet been printed.
+ message(STATUS "${msg}")
+
+ # Save the find details in the cache to avoid printing the same
+ # message again.
+ set("${DETAILS_VAR}" "${details}"
+ CACHE INTERNAL "Details about finding ${pkg}")
+ endif()
+ endif()
+endfunction()
diff --git a/VTK/CMake/NewCMake/SelectLibraryConfigurations.cmake b/VTK/CMake/NewCMake/SelectLibraryConfigurations.cmake
new file mode 100644
index 0000000..d710856
--- /dev/null
+++ b/VTK/CMake/NewCMake/SelectLibraryConfigurations.cmake
@@ -0,0 +1,81 @@
+#.rst:
+# SelectLibraryConfigurations
+# ---------------------------
+#
+#
+#
+# select_library_configurations( basename )
+#
+# This macro takes a library base name as an argument, and will choose
+# good values for basename_LIBRARY, basename_LIBRARIES,
+# basename_LIBRARY_DEBUG, and basename_LIBRARY_RELEASE depending on what
+# has been found and set. If only basename_LIBRARY_RELEASE is defined,
+# basename_LIBRARY will be set to the release value, and
+# basename_LIBRARY_DEBUG will be set to basename_LIBRARY_DEBUG-NOTFOUND.
+# If only basename_LIBRARY_DEBUG is defined, then basename_LIBRARY will
+# take the debug value, and basename_LIBRARY_RELEASE will be set to
+# basename_LIBRARY_RELEASE-NOTFOUND.
+#
+# If the generator supports configuration types, then basename_LIBRARY
+# and basename_LIBRARIES will be set with debug and optimized flags
+# specifying the library to be used for the given configuration. If no
+# build type has been set or the generator in use does not support
+# configuration types, then basename_LIBRARY and basename_LIBRARIES will
+# take only the release value, or the debug value if the release one is
+# not set.
+
+#=============================================================================
+# Copyright 2009 Will Dicharry <wdicharry at stellarscience.com>
+# Copyright 2005-2009 Kitware, Inc.
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+# License text for the above reference.)
+
+# This macro was adapted from the FindQt4 CMake module and is maintained by Will
+# Dicharry <wdicharry at stellarscience.com>.
+
+macro( select_library_configurations basename )
+ if(NOT ${basename}_LIBRARY_RELEASE)
+ set(${basename}_LIBRARY_RELEASE "${basename}_LIBRARY_RELEASE-NOTFOUND" CACHE FILEPATH "Path to a library.")
+ endif()
+ if(NOT ${basename}_LIBRARY_DEBUG)
+ set(${basename}_LIBRARY_DEBUG "${basename}_LIBRARY_DEBUG-NOTFOUND" CACHE FILEPATH "Path to a library.")
+ endif()
+
+ if( ${basename}_LIBRARY_DEBUG AND ${basename}_LIBRARY_RELEASE AND
+ NOT ${basename}_LIBRARY_DEBUG STREQUAL ${basename}_LIBRARY_RELEASE AND
+ ( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE ) )
+ # if the generator supports configuration types or CMAKE_BUILD_TYPE
+ # is set, then set optimized and debug options.
+ set( ${basename}_LIBRARY "" )
+ foreach( _libname IN LISTS ${basename}_LIBRARY_RELEASE )
+ list( APPEND ${basename}_LIBRARY optimized "${_libname}" )
+ endforeach()
+ foreach( _libname IN LISTS ${basename}_LIBRARY_DEBUG )
+ list( APPEND ${basename}_LIBRARY debug "${_libname}" )
+ endforeach()
+ elseif( ${basename}_LIBRARY_RELEASE )
+ set( ${basename}_LIBRARY ${${basename}_LIBRARY_RELEASE} )
+ elseif( ${basename}_LIBRARY_DEBUG )
+ set( ${basename}_LIBRARY ${${basename}_LIBRARY_DEBUG} )
+ else()
+ set( ${basename}_LIBRARY "${basename}_LIBRARY-NOTFOUND")
+ endif()
+
+ set( ${basename}_LIBRARIES "${${basename}_LIBRARY}" )
+
+ if( ${basename}_LIBRARY )
+ set( ${basename}_FOUND TRUE )
+ endif()
+
+ mark_as_advanced( ${basename}_LIBRARY_RELEASE
+ ${basename}_LIBRARY_DEBUG
+ )
+endmacro()
diff --git a/VTK/CMake/GenerateExportHeader.cmake b/VTK/CMake/VTKGenerateExportHeader.cmake
similarity index 86%
rename from VTK/CMake/GenerateExportHeader.cmake
rename to VTK/CMake/VTKGenerateExportHeader.cmake
index 11e7fad..6daf9f1 100644
--- a/VTK/CMake/GenerateExportHeader.cmake
+++ b/VTK/CMake/VTKGenerateExportHeader.cmake
@@ -1,12 +1,20 @@
+# This version of GenerateExportHeader has been modified from the CMake
+# official version to add support for adding arbitrary additional information
+# through the EXPORT_CODE define. Because of this modification we need to
+# namespace all the function calls to make sure that consumers properly call
+# our version instead of the CMake official version.
+#
+#
+#
# - Function for generation of export macros for libraries
# This module provides the function GENERATE_EXPORT_HEADER() and the
# accompanying ADD_COMPILER_EXPORT_FLAGS() function.
#
-# The GENERATE_EXPORT_HEADER function can be used to generate a file suitable
+# The VTK_GENERATE_EXPORT_HEADER function can be used to generate a file suitable
# for preprocessor inclusion which contains EXPORT macros to be used in
# library classes.
#
-# GENERATE_EXPORT_HEADER( LIBRARY_TARGET
+# VTK_GENERATE_EXPORT_HEADER( LIBRARY_TARGET
# [BASE_NAME <base_name>]
# [EXPORT_MACRO_NAME <export_macro_name>]
# [EXPORT_FILE_NAME <export_file_name>]
@@ -20,7 +28,7 @@
#
# ADD_COMPILER_EXPORT_FLAGS( [FATAL_WARNINGS] )
#
-# By default GENERATE_EXPORT_HEADER() generates macro names in a file name
+# By default VTK_GENERATE_EXPORT_HEADER() generates macro names in a file name
# determined by the name of the library. The ADD_COMPILER_EXPORT_FLAGS function
# adds -fvisibility=hidden to CMAKE_CXX_FLAGS if supported, and is a no-op on
# Windows which does not need extra compiler flags for exporting support. You
@@ -33,7 +41,7 @@
#
# add_compiler_export_flags()
# add_library(somelib someclass.cpp)
-# generate_export_header(somelib)
+# vtk_generate_export_header(somelib)
# install(TARGETS somelib DESTINATION ${LIBRARY_INSTALL_DIR})
# install(FILES
# someclass.h
@@ -57,7 +65,7 @@
# used for the macros
#
# add_library(somelib someclass.cpp)
-# generate_export_header(somelib
+# vtk_generate_export_header(somelib
# BASE_NAME other_name
# )
#
@@ -68,7 +76,7 @@
# For example:
#
# add_library(somelib someclass.cpp)
-# generate_export_header(somelib
+# vtk_generate_export_header(somelib
# EXPORT_MACRO_NAME OTHER_NAME_EXPORT
# )
#
@@ -76,7 +84,7 @@
# and the generated file name is as default.
#
# add_library(somelib someclass.cpp)
-# generate_export_header(somelib
+# vtk_generate_export_header(somelib
# DEPRECATED_MACRO_NAME KDE_DEPRECATED
# )
#
@@ -90,7 +98,7 @@
#
# add_library(shared_variant SHARED ${lib_SRCS})
# add_library(static_variant ${lib_SRCS})
-# generate_export_header(shared_variant BASE_NAME libshared_and_static)
+# vtk_generate_export_header(shared_variant BASE_NAME libshared_and_static)
# set_target_properties(static_variant PROPERTIES
# COMPILE_FLAGS -DLIBSHARED_AND_STATIC_STATIC_DEFINE)
#
@@ -105,7 +113,7 @@
# if (EXCLUDE_DEPRECATED)
# set(NO_BUILD_DEPRECATED DEFINE_NO_DEPRECATED)
# endif()
-# generate_export_header(somelib ${NO_BUILD_DEPRECATED})
+# vtk_generate_export_header(somelib ${NO_BUILD_DEPRECATED})
#
# And then in somelib:
#
@@ -126,7 +134,7 @@
#
# For example:
#
-# generate_export_header(somelib PREFIX_NAME VTK_)
+# vtk_generate_export_header(somelib PREFIX_NAME VTK_)
#
# Generates the macros VTK_SOMELIB_EXPORT etc.
@@ -147,7 +155,7 @@ include(CMakeParseArguments)
include(CheckCXXCompilerFlag)
# TODO: Install this macro separately?
-macro(_check_cxx_compiler_attribute _ATTRIBUTE _RESULT)
+macro(_vtk_check_cxx_compiler_attribute _ATTRIBUTE _RESULT)
check_cxx_source_compiles("${_ATTRIBUTE} int somefunc() { return 0; }
int main() { return somefunc();}" ${_RESULT}
# Some compilers do not fail with a bad flag
@@ -160,13 +168,13 @@ macro(_check_cxx_compiler_attribute _ATTRIBUTE _RESULT)
)
endmacro()
-macro(_test_compiler_hidden_visibility)
+macro(_vtk_test_compiler_hidden_visibility)
if(CMAKE_COMPILER_IS_GNUCXX)
execute_process(COMMAND ${CMAKE_C_COMPILER} --version
OUTPUT_VARIABLE _gcc_version_info
ERROR_VARIABLE _gcc_version_info)
- string(REGEX MATCH "[3456]\\.[0-9]\\.[0-9]*"
+ string(REGEX MATCH "[3-9]\\.[0-9]\\.[0-9]*"
_gcc_version "${_gcc_version_info}")
# gcc on mac just reports: "gcc (GCC) 3.3 20030304 ..." without the
# patch level, handle this here:
@@ -212,7 +220,7 @@ macro(_test_compiler_hidden_visibility)
endif()
endmacro()
-macro(_test_compiler_has_deprecated)
+macro(_vtk_test_compiler_has_deprecated)
if(CMAKE_CXX_COMPILER_ID MATCHES "Borland"
OR CMAKE_CXX_COMPILER_ID MATCHES "HP"
OR GCC_TOO_OLD
@@ -221,22 +229,22 @@ macro(_test_compiler_has_deprecated)
set(COMPILER_HAS_DEPRECATED "" CACHE INTERNAL
"Compiler support for a deprecated attribute")
else()
- _check_cxx_compiler_attribute("__attribute__((__deprecated__))"
+ _vtk_check_cxx_compiler_attribute("__attribute__((__deprecated__))"
COMPILER_HAS_DEPRECATED_ATTR)
if(COMPILER_HAS_DEPRECATED_ATTR)
set(COMPILER_HAS_DEPRECATED "${COMPILER_HAS_DEPRECATED_ATTR}"
CACHE INTERNAL "Compiler support for a deprecated attribute")
else()
- _check_cxx_compiler_attribute("__declspec(deprecated)"
+ _vtk_check_cxx_compiler_attribute("__declspec(deprecated)"
COMPILER_HAS_DEPRECATED)
endif()
endif()
endmacro()
-get_filename_component(_GENERATE_EXPORT_HEADER_MODULE_DIR
+get_filename_component(_VTK_GENERATE_EXPORT_HEADER_MODULE_DIR
"${CMAKE_CURRENT_LIST_FILE}" PATH)
-macro(_DO_SET_MACRO_VALUES TARGET_LIBRARY)
+macro(_vtk_do_set_macro_values TARGET_LIBRARY)
set(DEFINE_DEPRECATED)
set(DEFINE_EXPORT)
set(DEFINE_IMPORT)
@@ -262,7 +270,7 @@ macro(_DO_SET_MACRO_VALUES TARGET_LIBRARY)
endif()
endmacro()
-macro(_DO_GENERATE_EXPORT_HEADER TARGET_LIBRARY)
+macro(_vtk_do_generate_export_header TARGET_LIBRARY)
# Option overrides
set(options DEFINE_NO_DEPRECATED)
set(oneValueArgs PREFIX_NAME BASE_NAME EXPORT_MACRO_NAME EXPORT_FILE_NAME
@@ -337,11 +345,11 @@ macro(_DO_GENERATE_EXPORT_HEADER TARGET_LIBRARY)
set(EXPORT_IMPORT_CONDITION ${TARGET_LIBRARY}_EXPORTS)
endif()
- configure_file("${_GENERATE_EXPORT_HEADER_MODULE_DIR}/exportheader.cmake.in"
+ configure_file("${_VTK_GENERATE_EXPORT_HEADER_MODULE_DIR}/vtkexportheader.cmake.in"
"${EXPORT_FILE_NAME}" @ONLY)
endmacro()
-function(GENERATE_EXPORT_HEADER TARGET_LIBRARY)
+function(VTK_GENERATE_EXPORT_HEADER TARGET_LIBRARY)
get_property(type TARGET ${TARGET_LIBRARY} PROPERTY TYPE)
if(type STREQUAL "MODULE")
message(WARNING "This macro should not be used with libraries of type MODULE")
@@ -351,16 +359,16 @@ function(GENERATE_EXPORT_HEADER TARGET_LIBRARY)
message(WARNING "This macro can only be used with libraries")
return()
endif()
- _test_compiler_hidden_visibility()
- _test_compiler_has_deprecated()
- _do_set_macro_values(${TARGET_LIBRARY})
- _do_generate_export_header(${TARGET_LIBRARY} ${ARGN})
+ _vtk_test_compiler_hidden_visibility()
+ _vtk_test_compiler_has_deprecated()
+ _vtk_do_set_macro_values(${TARGET_LIBRARY})
+ _vtk_do_generate_export_header(${TARGET_LIBRARY} ${ARGN})
endfunction()
-function(add_compiler_export_flags)
+function(vtk_add_compiler_export_flags)
- _test_compiler_hidden_visibility()
- _test_compiler_has_deprecated()
+ _vtk_test_compiler_hidden_visibility()
+ _vtk_test_compiler_has_deprecated()
if(NOT (USE_COMPILER_HIDDEN_VISIBILITY AND COMPILER_HAS_HIDDEN_VISIBILITY))
# Just return if there are no flags to add.
diff --git a/VTK/CMake/vtkCompilerExtras.cmake b/VTK/CMake/vtkCompilerExtras.cmake
index 68c5980..e77b367 100644
--- a/VTK/CMake/vtkCompilerExtras.cmake
+++ b/VTK/CMake/vtkCompilerExtras.cmake
@@ -32,7 +32,7 @@ if(CMAKE_COMPILER_IS_GNUCXX)
OUTPUT_VARIABLE _gcc_version_info
ERROR_VARIABLE _gcc_version_info)
- string (REGEX MATCH "[3456]\\.[0-9]\\.[0-9]*"
+ string (REGEX MATCH "[3-9]\\.[0-9]\\.[0-9]*"
_gcc_version "${_gcc_version_info}")
if(NOT _gcc_version)
string (REGEX REPLACE ".*\\(GCC\\).*([34]\\.[0-9]).*" "\\1.0"
diff --git a/VTK/CMake/vtkModuleMacros.cmake b/VTK/CMake/vtkModuleMacros.cmake
index 4ace3f4..2c11582 100644
--- a/VTK/CMake/vtkModuleMacros.cmake
+++ b/VTK/CMake/vtkModuleMacros.cmake
@@ -3,7 +3,7 @@ get_filename_component(_VTKModuleMacros_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
set(_VTKModuleMacros_DEFAULT_LABEL "VTKModular")
include(${_VTKModuleMacros_DIR}/vtkModuleAPI.cmake)
-include(GenerateExportHeader)
+include(VTKGenerateExportHeader)
include(vtkWrapping)
if(VTK_MAKE_INSTANTIATORS)
include(vtkMakeInstantiator)
@@ -638,7 +638,7 @@ function(vtk_module_library name)
COMPILE_DEFINITIONS ${${vtk-module}_KIT}_EXPORTS)
set_target_properties(${vtk-module}Objects
PROPERTIES
- # Tell generate_export_header what kit-wide export symbol we use.
+ # Tell vtk_generate_export_header what kit-wide export symbol we use.
DEFINE_SYMBOL ${${vtk-module}_KIT}_EXPORTS
POSITION_INDEPENDENT_CODE TRUE)
endif()
@@ -704,15 +704,22 @@ VTK_AUTOINIT(${vtk-module})
set(${vtk-module}${target_suffix}_EXPORT_CODE
${${vtk-module}_EXPORT_CODE})
endif()
- generate_export_header(${vtk-module}${export_symbol_object} EXPORT_FILE_NAME ${vtk-module}Module.h)
+ vtk_generate_export_header(${vtk-module}${export_symbol_object} EXPORT_FILE_NAME ${vtk-module}Module.h)
if (BUILD_SHARED_LIBS)
# export flags are only added when building shared libs, they cause
# mismatched visibility warnings when building statically since not all
# libraries that VTK builds don't set visibility flags. Until we get a
# time to do that, we skip visibility flags for static libraries.
- add_compiler_export_flags(my_abi_flags)
- set_property(TARGET ${vtk-module}${target_suffix} APPEND
- PROPERTY COMPILE_FLAGS "${my_abi_flags}")
+ if(CMAKE_VERSION VERSION_LESS 3.3)
+ #CMake 3.3 deprecates add_compiler_export_flags and also has policy
+ #CMP0063 which properly propagates visibility flags to OBJECT libs
+ vtk_add_compiler_export_flags(my_abi_flags)
+ set_property(TARGET ${vtk-module}${target_suffix} APPEND
+ PROPERTY COMPILE_FLAGS "${my_abi_flags}")
+ else()
+ set_property(TARGET ${vtk-module}${target_suffix}
+ PROPERTY CXX_VISIBILITY_PRESET "hidden")
+ endif()
endif()
if(BUILD_TESTING AND PYTHON_EXECUTABLE AND NOT ${vtk-module}_NO_HeaderTest AND VTK_SOURCE_DIR)
diff --git a/VTK/CMake/vtkModuleTop.cmake b/VTK/CMake/vtkModuleTop.cmake
index 53adb15..db57eec 100644
--- a/VTK/CMake/vtkModuleTop.cmake
+++ b/VTK/CMake/vtkModuleTop.cmake
@@ -478,8 +478,8 @@ write_basic_package_version_file(
if (NOT VTK_INSTALL_NO_DEVELOPMENT)
install(FILES ${VTK_BINARY_DIR}/CMakeFiles/VTKConfig.cmake
${VTK_BINARY_DIR}/VTKConfigVersion.cmake
- CMake/exportheader.cmake.in
- CMake/GenerateExportHeader.cmake
+ CMake/vtkexportheader.cmake.in
+ CMake/VTKGenerateExportHeader.cmake
CMake/pythonmodules.h.in
CMake/UseVTK.cmake
CMake/FindTCL.cmake
diff --git a/VTK/CMake/exportheader.cmake.in b/VTK/CMake/vtkexportheader.cmake.in
similarity index 100%
rename from VTK/CMake/exportheader.cmake.in
rename to VTK/CMake/vtkexportheader.cmake.in
diff --git a/VTK/CMakeLists.txt b/VTK/CMakeLists.txt
index 3ac2e22..023e307 100644
--- a/VTK/CMakeLists.txt
+++ b/VTK/CMakeLists.txt
@@ -13,6 +13,7 @@ foreach(p
CMP0025 # CMake 3.0
CMP0053 # CMake 3.1
CMP0054 # CMake 3.1
+ CMP0063 # CMake 3.3
)
if(POLICY ${p})
cmake_policy(SET ${p} NEW)
diff --git a/VTK/Filters/ParallelGeometry/vtkPUnstructuredGridGhostCellsGenerator.cxx b/VTK/Filters/ParallelGeometry/vtkPUnstructuredGridGhostCellsGenerator.cxx
index fbd02f7..b4d7bf2 100644
--- a/VTK/Filters/ParallelGeometry/vtkPUnstructuredGridGhostCellsGenerator.cxx
+++ b/VTK/Filters/ParallelGeometry/vtkPUnstructuredGridGhostCellsGenerator.cxx
@@ -35,6 +35,7 @@
#include "vtkUnstructuredGrid.h"
#include "vtkCellData.h"
+#include <algorithm>
#include <vector>
#include <map>
#include <set>
@@ -162,6 +163,7 @@ vtkPUnstructuredGridGhostCellsGenerator::vtkPUnstructuredGridGhostCellsGenerator
this->Internals = NULL;
this->BuildIfRequired = true;
+ this->MinimumNumberOfGhostLevels = 1;
this->UseGlobalPointIds = true;
this->GlobalPointIdsArrayName = NULL;
@@ -193,6 +195,7 @@ void vtkPUnstructuredGridGhostCellsGenerator::PrintSelf(ostream& os, vtkIndent i
os << indent << "HasGlobalCellIds:" << HasGlobalCellIds << endl;
os << indent << "GlobalCellIdsArrayName:" << GlobalCellIdsArrayName << endl;
os << indent << "BuildIfRequired:" << BuildIfRequired << endl;
+ os << indent << "MinimumNumberOfGhostLevels: " << this->MinimumNumberOfGhostLevels << endl;
}
//-----------------------------------------------------------------------------
@@ -232,8 +235,9 @@ int vtkPUnstructuredGridGhostCellsGenerator::RequestData(
this->NumRanks = this->Controller ? this->Controller->GetNumberOfProcesses() : 1;
this->RankId = this->Controller ? this->Controller->GetLocalProcessId() : 0;
- int maxGhostLevel = this->BuildIfRequired ? outInfo->Get(
- vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_GHOST_LEVELS()) : 1;
+ int reqGhostLevel = outInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_GHOST_LEVELS());
+ int maxGhostLevel = this->BuildIfRequired ?
+ reqGhostLevel : std::max(reqGhostLevel, this->MinimumNumberOfGhostLevels);
if (maxGhostLevel == 0 || !this->Controller || this->NumRanks == 1)
{
diff --git a/VTK/Filters/ParallelGeometry/vtkPUnstructuredGridGhostCellsGenerator.h b/VTK/Filters/ParallelGeometry/vtkPUnstructuredGridGhostCellsGenerator.h
index 8e8998e..0df7d41 100644
--- a/VTK/Filters/ParallelGeometry/vtkPUnstructuredGridGhostCellsGenerator.h
+++ b/VTK/Filters/ParallelGeometry/vtkPUnstructuredGridGhostCellsGenerator.h
@@ -126,6 +126,15 @@ public:
vtkGetMacro(BuildIfRequired, bool);
vtkBooleanMacro(BuildIfRequired, bool);
+ // Description:
+ // When BuildIfRequired is `false`, this can be used to set the minimum number
+ // of ghost levels to generate. Note, if the downstream pipeline requests more
+ // ghost levels than the number specified here, then the filter will generate
+ // those extra ghost levels as needed. Accepted values are in the interval
+ // [1, VTK_INT_MAX].
+ vtkSetClampMacro(MinimumNumberOfGhostLevels, int, 1, VTK_INT_MAX);
+ vtkGetMacro(MinimumNumberOfGhostLevels, int);
+
protected:
vtkPUnstructuredGridGhostCellsGenerator();
~vtkPUnstructuredGridGhostCellsGenerator();
@@ -162,6 +171,7 @@ protected:
char *GlobalCellIdsArrayName;
bool HasGlobalCellIds;
bool BuildIfRequired;
+ int MinimumNumberOfGhostLevels;
private:
struct vtkInternals;
diff --git a/VTK/IO/Exodus/vtkExodusIIReader.cxx b/VTK/IO/Exodus/vtkExodusIIReader.cxx
index 2726fcd..b71550e 100644
--- a/VTK/IO/Exodus/vtkExodusIIReader.cxx
+++ b/VTK/IO/Exodus/vtkExodusIIReader.cxx
@@ -3840,17 +3840,25 @@ int vtkExodusIIReaderPrivate::UpdateTimeInformation()
int exoid = this->Exoid;
int itmp[5];
int num_timesteps;
+ int i;
VTK_EXO_FUNC( ex_inquire( exoid, EX_INQ_TIME, itmp, 0, 0 ), "Inquire for EX_INQ_TIME failed" );
num_timesteps = itmp[0];
this->Times.clear();
- // If there are zero or one timesteps, then there is only one file containing
- // the data to be read. So, we treat both instances in the same manner.
- if ( num_timesteps > 1 )
+ if ( num_timesteps > 0 )
{
this->Times.resize( num_timesteps );
- VTK_EXO_FUNC( ex_get_all_times( this->Exoid, &this->Times[0] ), "Could not retrieve time values." );
+
+ int exo_err = ex_get_all_times( this->Exoid, &this->Times[0] );
+ if ( exo_err < 0)
+ {
+ for ( i = 0; i < num_timesteps; ++i )
+ {
+ this->Times[i] = i;
+ }
+ vtkWarningMacro("Could not retrieve time values, assuming times equal to timesteps");
+ }
}
return 0;
}
diff --git a/VTK/IO/GDAL/Testing/Cxx/CMakeLists.txt b/VTK/IO/GDAL/Testing/Cxx/CMakeLists.txt
index cc07838..03691ce 100644
--- a/VTK/IO/GDAL/Testing/Cxx/CMakeLists.txt
+++ b/VTK/IO/GDAL/Testing/Cxx/CMakeLists.txt
@@ -1,5 +1,14 @@
+set(TestGDALRasterNoDataValue_ARGS
+ -D DATA{../Data/Input/TestGDALRasterNoDataValue.tif}
+)
+set(TestGDALRasterPalette_ARGS
+ -D DATA{../Data/Input/TestGDALRasterPalette.tif}
+)
+
vtk_add_test_cxx(${vtk-module}CxxTests tests
TestGDALVectorReader.cxx
TestGDALRasterReader.cxx
+ TestGDALRasterNoDataValue.cxx,NO_VALID,NO_OUTPUT
+ TestGDALRasterPalette.cxx
)
vtk_test_cxx_executable(${vtk-module}CxxTests tests)
diff --git a/VTK/IO/GDAL/Testing/Cxx/TestGDALRasterNoDataValue.cxx b/VTK/IO/GDAL/Testing/Cxx/TestGDALRasterNoDataValue.cxx
new file mode 100644
index 0000000..e56fb17
--- /dev/null
+++ b/VTK/IO/GDAL/Testing/Cxx/TestGDALRasterNoDataValue.cxx
@@ -0,0 +1,72 @@
+/*=========================================================================
+
+ Program: Visualization Toolkit
+ Module: TestGDALRasterReader.cxx
+
+ Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
+ All rights reserved.
+ See Copyright.txt or http://www.kitware.com/Copyright.htm for 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.
+
+=========================================================================*/
+#include <vtkGDALRasterReader.h>
+#include <vtkNew.h>
+#include <vtkUniformGrid.h>
+
+#include <iostream>
+
+// Main program
+int TestGDALRasterNoDataValue(int argc, char** argv)
+{
+ if (argc < 3)
+ {
+ std::cerr << "Expected TestName -D InputFile.tif" << std::endl;
+ return -1;
+ }
+
+ std::string inputFileName(argv[2]);
+
+ // Create reader to read shape file.
+ vtkNew<vtkGDALRasterReader> reader;
+ reader->SetFileName(inputFileName.c_str());
+ reader->Update();
+
+ vtkUniformGrid *rasterImage = vtkUniformGrid::SafeDownCast(
+ reader->GetOutput());
+
+ int numErrors = 0;
+
+ if (!rasterImage->HasAnyBlankPoints())
+ {
+ std::cerr << "Error image has no blank points" << std::endl;
+ ++numErrors;
+ }
+
+ if (!rasterImage->HasAnyBlankCells())
+ {
+ std::cerr << "Error image has no blank cells" << std::endl;
+ ++numErrors;
+ }
+
+ double *scalarRange = rasterImage->GetScalarRange();
+
+ if ((scalarRange[0] < -888.5) || (scalarRange[0]) > -887.5)
+ {
+ std::cerr << "Error scalarRange[0] should be -888.0, not "
+ << scalarRange[0] << std::endl;
+ ++numErrors;
+ }
+
+ if ((scalarRange[1] < 9998.5) || (scalarRange[1] > 9999.5))
+ {
+ std::cerr << "Error scalarRange[1] should be 9999.0, not "
+ << scalarRange[1] << std::endl;
+ ++numErrors;
+ }
+
+ //std::cout << "numErrors: " << numErrors << std::endl;
+ return numErrors;
+}
diff --git a/VTK/IO/GDAL/Testing/Cxx/TestGDALRasterPalette.cxx b/VTK/IO/GDAL/Testing/Cxx/TestGDALRasterPalette.cxx
new file mode 100644
index 0000000..88459ec
--- /dev/null
+++ b/VTK/IO/GDAL/Testing/Cxx/TestGDALRasterPalette.cxx
@@ -0,0 +1,108 @@
+/*=========================================================================
+
+ Program: Visualization Toolkit
+ Module: TestGDALRasterReader.cxx
+
+ Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
+ All rights reserved.
+ See Copyright.txt or http://www.kitware.com/Copyright.htm for 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.
+
+=========================================================================*/
+#include <vtkDataArray.h>
+#include <vtkGDALRasterReader.h>
+#include <vtkImageActor.h>
+#include <vtkImageProperty.h>
+#include <vtkLookupTable.h>
+#include <vtkNew.h>
+#include <vtkPointData.h>
+#include <vtkRegressionTestImage.h>
+#include <vtkRenderWindow.h>
+#include <vtkRenderer.h>
+#include <vtkRenderWindow.h>
+#include <vtkRenderWindowInteractor.h>
+#include <vtkUniformGrid.h>
+
+#include <iostream>
+
+// Main program
+int TestGDALRasterPalette(int argc, char** argv)
+{
+ if (argc < 3)
+ {
+ std::cerr << "Expected TestName -D InputFile.tif" << std::endl;
+ return -1;
+ }
+
+ std::string inputFileName(argv[2]);
+
+ // Create reader to read shape file.
+ vtkNew<vtkGDALRasterReader> reader;
+ reader->SetFileName(inputFileName.c_str());
+ reader->Update();
+ vtkUniformGrid *image = vtkUniformGrid::SafeDownCast(reader->GetOutput());
+
+ // Check that reader generated point scalars
+ if (image->GetPointData()->GetNumberOfArrays() < 1)
+ {
+ std::cerr << "ERROR: Missing point data scalars" << std::endl;
+ return 1;
+ }
+ if (image->GetPointData()->GetScalars()->GetSize() == 0)
+ {
+ std::cerr << "ERROR: Point data scalars empty" << std::endl;
+ return 1;
+ }
+ //image->GetPointData()->GetScalars()->Print(std::cout);
+
+ // Check that reader generated color table
+ vtkLookupTable *colorTable =
+ image->GetPointData()->GetScalars()->GetLookupTable();
+ if (!colorTable)
+ {
+ std::cerr << "ERROR: Missing color table" << std::endl;
+ return 1;
+ }
+ if (colorTable->GetNumberOfAvailableColors() != 256)
+ {
+ std::cerr << "ERROR: Color table does not have 256 colors."
+ << " Instead has " << colorTable->GetNumberOfAvailableColors()
+ << std::endl;
+ return 1;
+ }
+ //colorTable->Print(std::cout);
+
+ // Create a renderer and actor
+ vtkNew<vtkRenderer> renderer;
+ vtkNew<vtkImageActor> actor;
+ actor->SetInputData(reader->GetOutput());
+ actor->InterpolateOff();
+ //actor->GetProperty()->SetInterpolationTypeToNearest();
+ actor->GetProperty()->SetLookupTable(colorTable);
+ actor->GetProperty()->UseLookupTableScalarRangeOn();
+ renderer->AddActor(actor.GetPointer());
+
+ // Create a render window, and an interactor
+ vtkNew<vtkRenderWindow> renderWindow;
+ vtkNew<vtkRenderWindowInteractor> renderWindowInteractor;
+ renderWindow->AddRenderer(renderer.GetPointer());
+ renderWindowInteractor->SetRenderWindow(renderWindow.GetPointer());
+
+ //Add the actor to the scene
+ renderer->SetBackground(1.0, 1.0, 1.0);
+ renderWindow->SetSize(400, 400);
+ renderWindow->Render();
+ renderer->ResetCamera();
+ renderWindow->Render();
+
+ int retVal = vtkRegressionTestImage(renderWindow.GetPointer());
+ if (retVal == vtkRegressionTester::DO_INTERACTOR)
+ {
+ renderWindowInteractor->Start();
+ }
+
+ return !retVal;
+}
diff --git a/VTK/IO/GDAL/Testing/Data/Baseline/TestGDALRasterPalette.png.md5 b/VTK/IO/GDAL/Testing/Data/Baseline/TestGDALRasterPalette.png.md5
new file mode 100644
index 0000000..ef85ec4
--- /dev/null
+++ b/VTK/IO/GDAL/Testing/Data/Baseline/TestGDALRasterPalette.png.md5
@@ -0,0 +1 @@
+70aff17ba9e4a0d5c6cffb720f381d26
diff --git a/VTK/IO/GDAL/Testing/Data/Input/TestGDALRasterNoDataValue.tif.md5 b/VTK/IO/GDAL/Testing/Data/Input/TestGDALRasterNoDataValue.tif.md5
new file mode 100644
index 0000000..068edb8
--- /dev/null
+++ b/VTK/IO/GDAL/Testing/Data/Input/TestGDALRasterNoDataValue.tif.md5
@@ -0,0 +1 @@
+f73cb0b2de8941d9e491190d193f10a2
diff --git a/VTK/IO/GDAL/Testing/Data/Input/TestGDALRasterPalette.tif.md5 b/VTK/IO/GDAL/Testing/Data/Input/TestGDALRasterPalette.tif.md5
new file mode 100644
index 0000000..f02894f
--- /dev/null
+++ b/VTK/IO/GDAL/Testing/Data/Input/TestGDALRasterPalette.tif.md5
@@ -0,0 +1 @@
+cdffbf2b4f05e98cf0c0f10d34eb302a
diff --git a/VTK/IO/GDAL/vtkGDALRasterReader.cxx b/VTK/IO/GDAL/vtkGDALRasterReader.cxx
index 5d122e6..64f6535 100644
--- a/VTK/IO/GDAL/vtkGDALRasterReader.cxx
+++ b/VTK/IO/GDAL/vtkGDALRasterReader.cxx
@@ -24,6 +24,7 @@
#include "vtkInformationVector.h"
#include "vtkInformation.h"
#include "vtkIntArray.h"
+#include "vtkLookupTable.h"
#include "vtkMath.h"
#include "vtkObjectFactory.h"
#include "vtkPointData.h"
@@ -44,6 +45,7 @@
// C/C++ includes
#include <cassert>
#include <iostream>
+#include <sstream>
#include <vector>
vtkStandardNewMacro(vtkGDALRasterReader);
@@ -84,6 +86,9 @@ public:
const double* GetGeoCornerPoints();
+ void ReadColorTable(
+ GDALRasterBand *rasterBand, vtkLookupTable *colorTable) const;
+
int NumberOfBands;
int NumberOfBytesPerPixel;
@@ -101,6 +106,7 @@ public:
// Upper left, lower left, upper right, lower right
double CornerPoints[8];
+ int HasNoDataValue;
double NoDataValue;
vtkIdType NumberOfPoints;
@@ -277,17 +283,23 @@ void vtkGDALRasterReader::vtkGDALRasterReaderInternal::GenericReadData()
// Pixel data.
std::vector<RAW_TYPE> rawUniformGridData;
+ // Color table
+ vtkSmartPointer<vtkLookupTable> colorTable =
+ vtkSmartPointer<vtkLookupTable>::New();
+
// Possible bands
GDALRasterBand* redBand = 0;
GDALRasterBand* greenBand = 0;
GDALRasterBand* blueBand = 0;
GDALRasterBand* alphaBand = 0;
GDALRasterBand* greyBand = 0;
+ GDALRasterBand* paletteBand = 0;
for (int i = 1; i <= this->NumberOfBands; ++i)
{
GDALRasterBand* rasterBand = this->GDALData->GetRasterBand(i);
- NoDataValue = rasterBand->GetNoDataValue();
+ this->HasNoDataValue = 0;
+ this->NoDataValue = rasterBand->GetNoDataValue(&this->HasNoDataValue);
if (this->NumberOfBytesPerPixel == 0)
{
this->TargetDataType = rasterBand->GetRasterDataType();
@@ -328,6 +340,10 @@ void vtkGDALRasterReader::vtkGDALRasterReaderInternal::GenericReadData()
{
greyBand = rasterBand;
}
+ else if (rasterBand->GetColorInterpretation() == GCI_PaletteIndex)
+ {
+ paletteBand = rasterBand;
+ }
}
const int& destWidth = this->Reader->TargetDimensions[0];
@@ -434,6 +450,20 @@ void vtkGDALRasterReader::vtkGDALRasterReaderInternal::GenericReadData()
assert(err == CE_None);
}
}
+ else if (paletteBand)
+ {
+ // Read indexes
+ this->Reader->SetNumberOfScalarComponents(1);
+ rawUniformGridData.resize(destWidth * destHeight * pixelSpace);
+ err = paletteBand->RasterIO(
+ GF_Read, windowX, windowY, windowWidth, windowHeight,
+ static_cast<void*>(reinterpret_cast<GByte*>(&rawUniformGridData[0]) +
+ 0 * bandSpace), destWidth, destHeight,
+ this->TargetDataType, pixelSpace, lineSpace);
+ assert(err == CE_None);
+
+ this->ReadColorTable(paletteBand, colorTable.GetPointer());
+ }
else
{
std::cerr << "Unknown raster band type \n";
@@ -451,6 +481,13 @@ void vtkGDALRasterReader::vtkGDALRasterReaderInternal::GenericReadData()
this->UniformGridData->SetSpacing(geoSpacing[0], geoSpacing[1], geoSpacing[2]);
this->UniformGridData->SetOrigin(d[0], d[1], 0);
this->Convert<VTK_TYPE, RAW_TYPE>(rawUniformGridData, destWidth, destHeight);
+
+ if (paletteBand)
+ {
+ this->UniformGridData->GetPointData()->GetScalars()->SetName("Categories");
+ this->UniformGridData->GetPointData()->GetScalars()->SetLookupTable(
+ colorTable);
+ }
}
//----------------------------------------------------------------------------
@@ -480,6 +517,12 @@ void vtkGDALRasterReader::vtkGDALRasterReaderInternal::Convert(
scArr->SetNumberOfComponents(this->NumberOfBands);
scArr->SetNumberOfTuples(targetWidth * targetHeight);
+ RAW_TYPE TNoDataValue = 0;
+ if (this->HasNoDataValue)
+ {
+ TNoDataValue = static_cast<RAW_TYPE>(this->NoDataValue);
+ }
+
for (int j = 0; j < targetHeight; ++j)
{
for (int i = 0; i < targetWidth; ++i)
@@ -491,11 +534,18 @@ void vtkGDALRasterReader::vtkGDALRasterReaderInternal::Convert(
j * targetWidth * NumberOfBands + bandIndex;
sourceIndex = i + j * targetWidth +
bandIndex * targetWidth * targetHeight;
+
RAW_TYPE tmp = rawUniformGridData[sourceIndex];
- if(tmp < min) min = tmp;
- if(tmp > max) max = tmp;
- if(tmp == NoDataValue) this->UniformGridData->BlankPoint(targetIndex);
- else this->NumberOfPoints++;
+ if (this->HasNoDataValue && tmp == TNoDataValue)
+ {
+ this->UniformGridData->BlankPoint(targetIndex);
+ }
+ else
+ {
+ if(tmp < min) min = tmp;
+ if(tmp > max) max = tmp;
+ this->NumberOfPoints++;
+ }
scArr->InsertValue(targetIndex, rawUniformGridData[sourceIndex]);
}
@@ -596,6 +646,53 @@ const double* vtkGDALRasterReader::vtkGDALRasterReaderInternal::GetGeoCornerPoin
}
//-----------------------------------------------------------------------------
+void vtkGDALRasterReader::vtkGDALRasterReaderInternal::ReadColorTable(
+ GDALRasterBand *rasterBand, vtkLookupTable *colorTable) const
+{
+ GDALColorTable *gdalTable = rasterBand->GetColorTable();
+ if (gdalTable->GetPaletteInterpretation() != GPI_RGB)
+ {
+ std::cerr << "Color table palette type not supported "
+ << gdalTable->GetPaletteInterpretation() << std::endl;
+ return;
+ }
+
+ char **categoryNames = rasterBand->GetCategoryNames();
+
+ colorTable->IndexedLookupOn();
+ int numEntries = gdalTable->GetColorEntryCount();
+ colorTable->SetNumberOfTableValues(numEntries);
+ std::stringstream ss;
+ for (int i=0; i< numEntries; ++i)
+ {
+ const GDALColorEntry *gdalEntry = gdalTable->GetColorEntry(i);
+ double r = static_cast<double>(gdalEntry->c1) / 255.0;
+ double g = static_cast<double>(gdalEntry->c2) / 255.0;
+ double b = static_cast<double>(gdalEntry->c3) / 255.0;
+ double a = static_cast<double>(gdalEntry->c4) / 255.0;
+ colorTable->SetTableValue(i, r, g, b, a);
+
+ // Copy category name to lookup table annotation
+ if (categoryNames)
+ {
+ // Only use non-empty names
+ if (strlen(categoryNames[i]) > 0)
+ {
+ colorTable->SetAnnotation(vtkVariant(i), categoryNames[i]);
+ }
+ }
+ else
+ {
+ // Create default annotation
+ ss.str("");
+ ss.clear();
+ ss << "Category " << i;
+ colorTable->SetAnnotation(vtkVariant(i), ss.str());
+ }
+ }
+}
+
+//-----------------------------------------------------------------------------
void vtkGDALRasterReader::PrintSelf(std::ostream& os, vtkIndent indent)
{
this->Superclass::PrintSelf(os,indent);
diff --git a/VTK/IO/GDAL/vtkGDALRasterReader.h b/VTK/IO/GDAL/vtkGDALRasterReader.h
index 02500bd..065b58a 100644
--- a/VTK/IO/GDAL/vtkGDALRasterReader.h
+++ b/VTK/IO/GDAL/vtkGDALRasterReader.h
@@ -113,7 +113,7 @@ protected:
vtkGDALRasterReaderInternal* Implementation;
private:
- vtkGDALRasterReader(const vtkGDALRasterReader&); // Not implemented.
+ vtkGDALRasterReader(const vtkGDALRasterReader&); // Not implemented
void operator=(const vtkGDALRasterReader&); // Not implemented
};
diff --git a/VTK/IO/Geometry/vtkOpenFOAMReader.cxx b/VTK/IO/Geometry/vtkOpenFOAMReader.cxx
index 2e81dd2..cdb509b 100644
--- a/VTK/IO/Geometry/vtkOpenFOAMReader.cxx
+++ b/VTK/IO/Geometry/vtkOpenFOAMReader.cxx
@@ -3360,6 +3360,15 @@ void vtkFoamEntryValue::ReadList(vtkFoamIOobject& io)
{
this->Superclass::ScalarListPtr->InsertNextValue(currToken.To<float>());
}
+ else if (currToken == '(')
+ {
+ vtkGenericWarningMacro("Found a list containing scalar data followed "
+ "by a nested list, but this reader only "
+ "supports nested lists that precede all "
+ "scalars. Discarding nested list data.");
+ vtkFoamEntryValue tmp(this->UpperEntryPtr);
+ tmp.ReadList(io);
+ }
else
{
throw vtkFoamError() << "Expected a number, found " << currToken;
diff --git a/VTK/Rendering/OpenGL2/vtkDualDepthPeelingPass.cxx b/VTK/Rendering/OpenGL2/vtkDualDepthPeelingPass.cxx
index ce9a51c..4397590 100644
--- a/VTK/Rendering/OpenGL2/vtkDualDepthPeelingPass.cxx
+++ b/VTK/Rendering/OpenGL2/vtkDualDepthPeelingPass.cxx
@@ -270,10 +270,13 @@ vtkDualDepthPeelingPass::vtkDualDepthPeelingPass()
: RenderState(NULL),
CopyDepthProgram(NULL),
CopyDepthVAO(NULL),
+ CopyDepthVBO(NULL),
BackBlendProgram(NULL),
BackBlendVAO(NULL),
+ BackBlendVBO(NULL),
BlendProgram(NULL),
BlendVAO(NULL),
+ BlendVBO(NULL),
Framebuffer(NULL),
FrontSource(FrontA),
FrontDestination(FrontB),
@@ -335,8 +338,11 @@ void vtkDualDepthPeelingPass::FreeGLObjects()
}
DeleteHelper(this->CopyDepthVAO);
+ DeleteHelper(this->CopyDepthVBO);
DeleteHelper(this->BackBlendVAO);
+ DeleteHelper(this->BackBlendVBO);
DeleteHelper(this->BlendVAO);
+ DeleteHelper(this->BlendVBO);
// don't delete the shader programs -- let the cache clean them up.
}
@@ -585,8 +591,10 @@ void vtkDualDepthPeelingPass::CopyOpaqueDepthBuffer()
if (!this->CopyDepthVAO)
{
+ this->CopyDepthVBO = vtkOpenGLBufferObject::New();
this->CopyDepthVAO = vtkOpenGLVertexArrayObject::New();
- GLUtil::PrepFullScreenVAO(this->CopyDepthVAO, this->CopyDepthProgram);
+ GLUtil::PrepFullScreenVAO(this->CopyDepthVBO, this->CopyDepthVAO,
+ this->CopyDepthProgram);
}
// Get the clear value. We don't set this, so it should still be what the
@@ -755,8 +763,10 @@ void vtkDualDepthPeelingPass::BlendBackBuffer()
if (!this->BackBlendVAO)
{
+ this->BackBlendVBO = vtkOpenGLBufferObject::New();
this->BackBlendVAO = vtkOpenGLVertexArrayObject::New();
- GLUtil::PrepFullScreenVAO(this->BackBlendVAO, this->BackBlendProgram);
+ GLUtil::PrepFullScreenVAO(this->BackBlendVBO, this->BackBlendVAO,
+ this->BackBlendProgram);
}
this->BackBlendProgram->SetUniformi(
@@ -891,23 +901,34 @@ void vtkDualDepthPeelingPass::BlendFinalImage()
this->Textures[this->FrontSource]->Activate();
this->Textures[Back]->Activate();
- /* The final pixel (including the opaque layer is:
+ /* Peeling is done, time to blend the front and back peel textures with the
+ * opaque geometry in the existing framebuffer. First, we'll underblend the
+ * back texture beneath the front texture in the shader:
*
- * C = (1 - b.a) * f.a * o.a * o.rgb + f.a * (b.a * b.rgb) + f.rgb
+ * Blend 'b' under 'f' to form 't':
+ * t.rgb = f.a * b.a * b.rgb + f.rgb
+ * t.a = (1 - b.a) * f.a
*
- * ( C = final color; o = opaque frag; b = back frag; f = front frag )
+ * ( t = translucent layer (back + front), f = front layer, b = back layer )
*
- * This is obtained from repeatedly applying the underblend equations:
+ * Also in the shader, we adjust the translucent layer's alpha so that it
+ * can be used for back-to-front blending, so
*
- * C = f.a * b.a * b.rgb + f.rgb
- * a = (1 - b.a) * f.a
+ * alphaOverBlend = 1. - alphaUnderBlend
+ *
+ * To blend the translucent layer over the opaque layer, use regular
+ * overblending via glBlendEquation/glBlendFunc:
+ *
+ * Blend 't' over 'o'
+ * C = t.rgb + o.rgb * (1 - t.a)
+ * a = t.a + o.a * (1 - t.a)
*
* These blending parameters and fragment shader perform this work.
* Note that the opaque fragments are assumed to have premultiplied alpha
* in this implementation. */
glEnable(GL_BLEND);
glBlendEquation(GL_FUNC_ADD);
- glBlendFunc(GL_ONE, GL_SRC_ALPHA);
+ glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
typedef vtkOpenGLRenderUtilities GLUtil;
@@ -928,7 +949,10 @@ void vtkDualDepthPeelingPass::BlendFinalImage()
" front.a = 1. - front.a; // stored as (1 - alpha)\n"
" // Underblend. Back color is premultiplied:\n"
" gl_FragData[0].rgb = (front.rgb + back.rgb * front.a);\n"
- " gl_FragData[0].a = front.a * (1 - back.a);\n"
+ " // The first '1. - ...' is to convert the 'underblend' alpha to\n"
+ " // an 'overblend' alpha, since we'll be letting GL do the\n"
+ " // transparent-over-opaque blending pass.\n"
+ " gl_FragData[0].a = (1. - front.a * (1. - back.a));\n"
);
this->BlendProgram = renWin->GetShaderCache()->ReadyShaderProgram(
GLUtil::GetFullScreenQuadVertexShader().c_str(),
@@ -942,8 +966,10 @@ void vtkDualDepthPeelingPass::BlendFinalImage()
if (!this->BlendVAO)
{
+ this->BlendVBO = vtkOpenGLBufferObject::New();
this->BlendVAO = vtkOpenGLVertexArrayObject::New();
- GLUtil::PrepFullScreenVAO(this->BlendVAO, this->BlendProgram);
+ GLUtil::PrepFullScreenVAO(this->BlendVBO, this->BlendVAO,
+ this->BlendProgram);
}
this->BlendProgram->SetUniformi(
diff --git a/VTK/Rendering/OpenGL2/vtkDualDepthPeelingPass.h b/VTK/Rendering/OpenGL2/vtkDualDepthPeelingPass.h
index 7e65152..5995dd3 100644
--- a/VTK/Rendering/OpenGL2/vtkDualDepthPeelingPass.h
+++ b/VTK/Rendering/OpenGL2/vtkDualDepthPeelingPass.h
@@ -163,12 +163,15 @@ protected:
vtkShaderProgram *CopyDepthProgram;
vtkOpenGLVertexArrayObject *CopyDepthVAO;
+ vtkOpenGLBufferObject *CopyDepthVBO;
vtkShaderProgram *BackBlendProgram;
vtkOpenGLVertexArrayObject *BackBlendVAO;
+ vtkOpenGLBufferObject *BackBlendVBO;
vtkShaderProgram *BlendProgram;
vtkOpenGLVertexArrayObject *BlendVAO;
+ vtkOpenGLBufferObject *BlendVBO;
vtkFrameBufferObject2 *Framebuffer;
vtkTextureObject *Textures[NumberOfTextures];
diff --git a/VTK/Rendering/OpenGL2/vtkOpenGLRenderUtilities.cxx b/VTK/Rendering/OpenGL2/vtkOpenGLRenderUtilities.cxx
index 649564e..557b41d 100644
--- a/VTK/Rendering/OpenGL2/vtkOpenGLRenderUtilities.cxx
+++ b/VTK/Rendering/OpenGL2/vtkOpenGLRenderUtilities.cxx
@@ -19,21 +19,6 @@
#include "vtkOpenGLBufferObject.h"
#include "vtkOpenGLVertexArrayObject.h"
-// Static initializion:
-vtkOpenGLBufferObject *vtkOpenGLRenderUtilities::FullScreenQuadVerts = NULL;
-struct vtkOpenGLRenderUtilities::FSQVertsCleanUp
-{
- ~FSQVertsCleanUp()
- {
- if (vtkOpenGLRenderUtilities::FullScreenQuadVerts)
- {
- vtkOpenGLRenderUtilities::FullScreenQuadVerts->Delete();
- vtkOpenGLRenderUtilities::FullScreenQuadVerts = NULL;
- }
- }
-};
-vtkOpenGLRenderUtilities::FSQVertsCleanUp vtkFSQVertsCleanUp;
-
// ----------------------------------------------------------------------------
vtkOpenGLRenderUtilities::vtkOpenGLRenderUtilities()
{
@@ -153,36 +138,30 @@ std::string vtkOpenGLRenderUtilities::GetFullScreenQuadGeometryShader()
}
//------------------------------------------------------------------------------
-bool vtkOpenGLRenderUtilities::PrepFullScreenVAO(vtkOpenGLVertexArrayObject *vao,
+bool vtkOpenGLRenderUtilities::PrepFullScreenVAO(vtkOpenGLBufferObject *vertBuf,
+ vtkOpenGLVertexArrayObject *vao,
vtkShaderProgram *prog)
{
bool res;
typedef vtkOpenGLRenderUtilities GLUtil;
- if (!GLUtil::FullScreenQuadVerts)
+ // ndCoord_x, ndCoord_y, texCoord_x, texCoord_y
+ float verts[16] = { 1.f, 1.f, 1.f, 1.f,
+ -1.f, 1.f, 0.f, 1.f,
+ 1.f,-1.f, 1.f, 0.f,
+ -1.f,-1.f, 0.f, 0.f };
+
+ vertBuf->SetType(vtkOpenGLBufferObject::ArrayBuffer);
+ res = vertBuf->Upload(verts, 16, vtkOpenGLBufferObject::ArrayBuffer);
+ if (!res)
{
- GLUtil::FullScreenQuadVerts = vtkOpenGLBufferObject::New();
-
- // ndCoord_x, ndCoord_y, texCoord_x, texCoord_y
- float verts[4][4] = { { 1.f, 1.f, 1.f, 1.f },
- {-1.f, 1.f, 0.f, 1.f },
- { 1.f,-1.f, 1.f, 0.f },
- {-1.f,-1.f, 0.f, 0.f } };
-
- GLUtil::FullScreenQuadVerts->SetType(vtkOpenGLBufferObject::ArrayBuffer);
- res = GLUtil::FullScreenQuadVerts->Upload(
- verts, 16, vtkOpenGLBufferObject::ArrayBuffer);
- if (!res)
- {
- vtkGenericWarningMacro("Error uploading fullscreen quad vertex data.");
- return false;
- }
+ vtkGenericWarningMacro("Error uploading fullscreen quad vertex data.");
+ return false;
}
vao->Bind();
- res = vao->AddAttributeArray(prog, GLUtil::FullScreenQuadVerts, "ndCoordIn",
- 0, 4 * sizeof(float),
+ res = vao->AddAttributeArray(prog, vertBuf, "ndCoordIn", 0, 4 * sizeof(float),
VTK_FLOAT, 2, false);
if (!res)
{
@@ -191,9 +170,8 @@ bool vtkOpenGLRenderUtilities::PrepFullScreenVAO(vtkOpenGLVertexArrayObject *vao
return false;
}
- res = vao->AddAttributeArray(prog, GLUtil::FullScreenQuadVerts, "texCoordIn",
- 2 * sizeof(float), 4 * sizeof(float),
- VTK_FLOAT, 2, false);
+ res = vao->AddAttributeArray(prog, vertBuf, "texCoordIn", 2 * sizeof(float),
+ 4 * sizeof(float), VTK_FLOAT, 2, false);
if (!res)
{
vao->Release();
diff --git a/VTK/Rendering/OpenGL2/vtkOpenGLRenderUtilities.h b/VTK/Rendering/OpenGL2/vtkOpenGLRenderUtilities.h
index 32540c7..e85ee82 100644
--- a/VTK/Rendering/OpenGL2/vtkOpenGLRenderUtilities.h
+++ b/VTK/Rendering/OpenGL2/vtkOpenGLRenderUtilities.h
@@ -78,9 +78,10 @@ public:
// fragShader.c_str(),
// GLUtil::GetFullScreenQuadGeometryShader().c_str());
//
- // // Initialize new VAO:
+ // // Initialize new VAO/vertex buffer. This is only done once:
+ // vtkNew<vtkOpenGLBufferObject> verts;
// vtkNew<vtkOpenGLVertexArrayObject> vao;
- // GLUtil::PrepFullScreenVAO(vao.Get(), prog);
+ // GLUtil::PrepFullScreenVAO(verts.Get(), vao.Get(), prog);
//
// // Setup shader program to sample vtkTextureObject aTexture:
// aTexture->Activate();
@@ -95,20 +96,15 @@ public:
static std::string GetFullScreenQuadVertexShader();
static std::string GetFullScreenQuadFragmentShaderTemplate();
static std::string GetFullScreenQuadGeometryShader();
- static bool PrepFullScreenVAO(vtkOpenGLVertexArrayObject *vao,
+ static bool PrepFullScreenVAO(vtkOpenGLBufferObject *verts,
+ vtkOpenGLVertexArrayObject *vao,
vtkShaderProgram *prog);
static void DrawFullScreenQuad();
- // Description:
- // Implementation detail -- do not use.
- struct FSQVertsCleanUp;
-
protected:
vtkOpenGLRenderUtilities();
~vtkOpenGLRenderUtilities();
- static vtkOpenGLBufferObject *FullScreenQuadVerts;
-
private:
vtkOpenGLRenderUtilities(const vtkOpenGLRenderUtilities&); // Not implemented.
void operator=(const vtkOpenGLRenderUtilities&); // Not implemented.
diff --git a/VTK/Rendering/OpenGL2/vtkOpenGLRenderer.cxx b/VTK/Rendering/OpenGL2/vtkOpenGLRenderer.cxx
index 5a0d08f..1f81da1 100644
--- a/VTK/Rendering/OpenGL2/vtkOpenGLRenderer.cxx
+++ b/VTK/Rendering/OpenGL2/vtkOpenGLRenderer.cxx
@@ -50,6 +50,7 @@ PURPOSE. See the above copyright notice for more information.
#include <cmath>
#include <cassert>
+#include <cstdlib>
#include <list>
#include <string>
@@ -319,6 +320,19 @@ void vtkOpenGLRenderer::DeviceRenderTranslucentPolygonalGeometry()
}
}
+ // The old implemention can be force by defining the environment var
+ // "VTK_USE_LEGACY_DEPTH_PEELING":
+ if (dualDepthPeelingSupported)
+ {
+ const char *forceLegacy = getenv("VTK_USE_LEGACY_DEPTH_PEELING");
+ if (forceLegacy)
+ {
+ vtkDebugMacro("Disabling dual depth peeling -- "
+ "VTK_USE_LEGACY_DEPTH_PEELING defined in environment.");
+ dualDepthPeelingSupported = false;
+ }
+ }
+
if (dualDepthPeelingSupported)
{
#if GL_ES_VERSION_2_0 != 1 // vtkDualDepthPeelingPass is not built on ES2
diff --git a/VTK/ThirdParty/hdf5/module.cmake b/VTK/ThirdParty/hdf5/module.cmake
index 2572e2c..aa55f36 100644
--- a/VTK/ThirdParty/hdf5/module.cmake
+++ b/VTK/ThirdParty/hdf5/module.cmake
@@ -1,5 +1,13 @@
+if(BUILD_SHARED_LIBS)
+ set(HDF5_USE_STATIC_LIBS FALSE)
+else()
+ set(HDF5_USE_STATIC_LIBS ON)
+endif()
vtk_module(vtkhdf5
DEPENDS
vtkzlib
EXCLUDE_FROM_WRAPPING
)
+if(VTK_USE_SYSTEM_HDF5)
+ set(vtkhdf5_LIBRARIES ${HDF5_LIBRARIES} ${HDF5_HL_LIBRARIES})
+endif()
diff --git a/VTK/ThirdParty/xdmf2/vtkxdmf2/CMakeLists.txt b/VTK/ThirdParty/xdmf2/vtkxdmf2/CMakeLists.txt
index 71ab548..9fe3e94 100644
--- a/VTK/ThirdParty/xdmf2/vtkxdmf2/CMakeLists.txt
+++ b/VTK/ThirdParty/xdmf2/vtkxdmf2/CMakeLists.txt
@@ -38,16 +38,29 @@ if(EXISTS "${HDF5_CONFIG}")
add_definitions(${HDF5_EXTRA_FLAGS})
endif()
+# Some HDF5 configurations don't properly detect parallel support so
+# we need to do it manually ourselves
+if(NOT HDF5_IS_PARALLEL)
+ include(CheckSymbolExists)
+ set(CMAKE_REQUIRED_INCLUDES ${XDMF_HDF5_INCLUDE_DIRS})
+ check_symbol_exists(H5_HAVE_PARALLEL hdf5.h HDF5_IS_PARALLEL)
+ unset(CMAKE_REQUIRED_INCLUDES)
+endif()
+
#optional dependencies
#MPI
option(XDMF_BUILD_MPI "XDMF should use MPI" OFF)
mark_as_advanced(XDMF_BUILD_MPI)
+if(HDF5_IS_PARALLEL AND NOT XDMF_BUILD_MPI)
+ message(STATUS "Xdmf2: Enabling MPI since a parallel HDF5 is being used.")
+ set(XDMF_BUILD_MPI ON)
+endif()
if (XDMF_BUILD_MPI)
find_package(MPI REQUIRED)
include_directories(${MPI_C_INCLUDE_PATH})
set(XDMF_MPI_LIBRARIES ${MPI_C_LIBRARIES})
if (MPI_CXX_LIBRARIES)
- set (XDMF_MPI_LIBRARIES ${XDMF_MPI_LIBRARIES} ${MPI_CXX_LIBRARIES})
+ list(APPEND XDMF_MPI_LIBRARIES ${MPI_CXX_LIBRARIES})
endif()
add_definitions(-DMPICH_IGNORE_CXX_SEEK)
else()
diff --git a/VTK/Wrapping/PythonCore/CMakeLists.txt b/VTK/Wrapping/PythonCore/CMakeLists.txt
index 6a968f4..81b70e5 100644
--- a/VTK/Wrapping/PythonCore/CMakeLists.txt
+++ b/VTK/Wrapping/PythonCore/CMakeLists.txt
@@ -1,4 +1,4 @@
-include(GenerateExportHeader)
+include(VTKGenerateExportHeader)
include(vtkPythonWrapping)
set(Module_SRCS
diff --git a/Wrapping/Python/paraview/cinemaIO/pv_introspect.py b/Wrapping/Python/paraview/cinemaIO/pv_introspect.py
index f93e2ae..c9119ce 100644
--- a/Wrapping/Python/paraview/cinemaIO/pv_introspect.py
+++ b/Wrapping/Python/paraview/cinemaIO/pv_introspect.py
@@ -36,7 +36,7 @@ import cinema_store
import paraview
import pv_explorers
from itertools import imap
-
+import math
import numpy as np
def record_visibility():
@@ -449,7 +449,13 @@ def explore(cs, proxies, iSave=True, currentTime=None, userDefined = {}):
dist = paraview.simple.GetActiveCamera().GetDistance()
#associate control points wlth parameters of the data store
- cam = pv_explorers.Camera([0,0,0], [0,1,0], dist, view_proxy)
+ up = [math.fabs(x) for x in view_proxy.CameraViewUp]
+ uppest = 0
+ if up[1]>up[uppest]: uppest = 1
+ if up[2]>up[uppest]: uppest = 2
+ cinup = [0,0,0]
+ cinup[uppest]=1
+ cam = pv_explorers.Camera(view_proxy.CameraFocalPoint, cinup, dist, view_proxy)
params = cs.parameter_list.keys()
diff --git a/version.txt b/version.txt
index acf69b4..61fcc87 100644
--- a/version.txt
+++ b/version.txt
@@ -1 +1 @@
-5.1.0
\ No newline at end of file
+5.1.2
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/paraview.git
More information about the debian-science-commits
mailing list